DragonFlyBSD Kernel Audit
DF-2073 / build.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2073 build.sh -- HW-gated (AR5212 ath(4) NIC absent on guest).
# No userspace PoC to compile (the bug is a HAL register-write path that
# cannot be reached without the NIC). This script instead validates the fix:
#   1. trace the cited source (ar5212_keycache.c:86-93) -- already done in VERDICT.md
#   2. apply fix.diff to /usr/src and build a single-fix kernel
#
# Run from the host (uses dfbsd-qemu/vm.sh):
set -eu
cd "$(dirname "$0")/../../.."   # repo root

# Push the fix and apply on the guest source.
scp -q -F dfbsd-qemu/config findings/poc/DF-2073/fix.diff dfbsd:/root/fix2073.diff
# (apply may need file-targeting depending on patch version; the validated
#  method in this run was to copy the fixed .c directly -- see VERDICT.md)
./dfbsd-qemu/vm.sh run_root 'cd /usr/src && patch -p1 --forward < /root/fix2073.diff || true'
echo "fix.diff pushed; see VERDICT.md for the validated build (combined kernel, rc=0 -Werror)."