DragonFlyBSD Kernel Audit
DF-2618 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2618 run (against the STOCK INVARIANTS kernel):
#   control first (must be clean), then craft (expect the panic below).
# After the craft run the guest is down; capture serial with:
#   dfbsd-qemu/vm.sh log    (see panic.txt / panic2.txt for captured output)
set -e
CD=$(dirname "$0")
CFG=${CFG:-../../dfbsd-qemu/config}

ssh -F "$CFG" dfbsd 'sh /root/poc/df2618/trigger.sh control'

echo "=== craft run: expect panic at 'stat /mnt/h2/c' ==="
timeout 120 ssh -F "$CFG" dfbsd 'sh /root/poc/df2618/trigger.sh craft' || true
sleep 3
dfbsd-qemu/vm.sh status     # expect: down
echo "=== serial panic ==="
dfbsd-qemu/vm.sh log 40 | grep -A12 "panic: hammer2_chain_insert"