DF-3035 / build.log
# build.log — DF-3035
# All commands run as root in the QEMU guest unless noted.
## 1. PoC tool build (guest)
$ cc -O -o /tmp/cgxtool /root/poc/cgxtool.c
(no output — clean compile; rebuilt twice during iterations, always clean;
final rebuild on the patched kernel also clean: "cgxtool-rebuild-clean")
cgxtool.c compiles against local copies of sys/vfs/ufs/{fs.h,dinode.h}
pushed from the audit tree (with _KERNEL_STRUCTURES + 32-bit
ufs_daddr_t/ufs_time_t typedefs matching sys/vfs/ufs/ufs_types.h:41-42).
## 2. Stock-kernel baseline
No kernel build needed; guest ran the stock INVARIANTS kernel
(#1: Mon Jun 29 14:18:01 UTC 2026).
## 3. Fix-validation kernel build (guest)
$ cd /usr/src && patch -p1 < /tmp/fix3035.diff
Patching file sys/vfs/ufs/ffs_alloc.c using Plan A...
Hunk #1 succeeded at 80.
Hunk #2 succeeded at 873.
Hunk #3 succeeded at 954.
Hunk #4 succeeded at 1036.
Hunk #5 succeeded at 1268.
Hunk #6 succeeded at 1401.
Hunk #7 succeeded at 1552.
Hunk #8 succeeded at 1816.
Hunk #9 succeeded at 1909.
done
$ cd /usr/src && make -j4 nativekernel KERNCONF=X86_64_GENERIC
(full build; the audited file compiled -Werror-clean:)
cc -c -O2 -pipe -Wall ... -Werror -std=gnu11 -fno-common -ffreestanding \
... -mcmodel=kernel ... /usr/src/sys/vfs/ufs/ffs_alloc.c -Werror
-> ffs_alloc.o (no diagnostics)
BUILD-RC=0
$ cd /usr/src && make installkernel KERNCONF=X86_64_GENERIC
>>> Kernel install for X86_64_GENERIC completed on Sat Sep 5 14:13:03 UTC 2026
IK-RC=0
-r-xr-xr-x 1 root wheel 119345024 Sep 5 14:11 /boot/kernel/kernel
$ reboot -> DragonFly ... #1: Sat Sep 5 14:02:46 UTC 2026 root@dfbsd:...
## 4. Notes
/tmp in the guest is cleared at boot, so /tmp/kbuild.log did not survive
the reboot; the decisive lines above were captured live during the build
(the ffs_alloc.c -Werror compile line and BUILD-RC=0 were observed in
two separate polls of the running build).