Nonreproducible kernel modules on stable/12

Warner Losh imp at bsdimp.com
Tue Mar 31 21:56:06 UTC 2020


On Tue, Mar 31, 2020 at 8:08 AM Ed Maste <emaste at freebsd.org> wrote:

> Originally reported off-list, during a stable/12 freebsd-update build
> kernel modules are not reproducible and thus get included in the
> update.
>
> diffoscope reports that the .SUNW_ctf section is responsible:
>
> --- cam.0.ko
> +++ cam.1.ko
> ├── readelf --wide --sections {}
> ...
> │    [30] .shstrtab         STRTAB          0000000000000000 0ea828
> 0001f8 00      0   0  1
> │ -  [31] .SUNW_ctf         PROGBITS        0000000000000000 0f29d8
> 00e2ad 00     32   0  4
> │ +  [31] .SUNW_ctf         PROGBITS        0000000000000000 0f29d8
> 00e2b1 00     32   0  4
> │    [32] .symtab           SYMTAB          0000000000000000 0e12b8
> 009570 18     33 1001  8
> ...
> ├── readelf --wide --decompress --hex-dump=.SUNW_ctf {}
> │ @@ -1,3630 +1,3631 @@
>> │  Hex dump of section '.SUNW_ctf':
> │    0x00000000 f1cf0201 00000000 00000000 00000000 ................
> │    0x00000010 08000000 96040000 fc250000 f4310100 .........%...1..
> │ -  0x00000020 6aeb0000 78dabc7d 077c54c5 16f7ccbd j...x..}.|T.....
> │ -  0x00000030 774b42ca 26b48524 b0402001 02440d10 wKB.&..$.@ ..D..
> ...
> │ +  0x00000020 6feb0000 78dabc7d 077c54c5 16f7ccdc o...x..}.|T.....
> │ +  0x00000030 bb252165 13da4242 586a0204 081820d4 .%!e..BBXj.... .
>
> (And build-ID and GNU debuglink differ as a result.)
>
> Running ctfdump and comparing the result shows the issue:
>
> --- a   2020-03-31 10:04:39.766567000 -0400
> +++ b   2020-03-31 10:04:44.663292000 -0400
> @@ -11,11 +11,11 @@
>    cth_funcoff  = 1174
>    cth_typeoff  = 9724
>    cth_stroff   = 78324
> -  cth_strlen   = 60266
> +  cth_strlen   = 60271
>
>  - Label Table
> ----------------------------------------------------------------
>
> -   2407 FreeBSD 12.1-STABLE amd64 1201512
> +   2407 FreeBSD 12.1-FUTUREBUILD amd64 1201512
>

So is this before/after the change? When I built stable/12 twice in a row,
I get identical binaries. I get the same md5's for all the .ko's build as
part of buildkernel/installkernel.

Why is this string even in the binary? The string FUTUREBUILD doesn't
appear at all in newvers.sh. Nor anywhere in the FreeBSD tree. This has got
to be a FreeBSD update builder bug. Where's the source to it? The bug is in
there.

Warner


More information about the freebsd-reproducibility mailing list