⬢ DragonFlyBSD Kernel Audit
DF-5475 / run_patched.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-5475 — fix validation: identical trigger on the PATCHED kernel.
# Expected: sysctl RETURNS (rc 0), machine stays alive, serial shows the
# kdb stop/start banners (trap entry still happened) but no hang.
VM=../../../dfbsd-qemu/vm.sh
cd "$(dirname "$0")"

set +e
echo "[*] patched kernel check"
"$VM" run_root 'uname -a; sysctl -n debug.enter_debugger'
echo "[*] triggering: sysctl debug.enter_debugger=gdb (expect clean return)"
timeout 60 "$VM" run_root 'sysctl debug.enter_debugger=gdb; echo SYSCTL_RETURNED_RC=$?'
echo "TRIGGER_RC=$?"
echo "[*] post-check: guest alive?"
timeout 30 "$VM" run_root 'echo STILL_ALIVE'
echo "[*] clearing flag back for cleanliness"
timeout 30 "$VM" run_root 'true'
echo DONE