⬢ DragonFlyBSD Kernel Audit
DF-2606 / stress-fix.sh
← back to finding ↓ download raw
#!/bin/sh
# stress-fix.sh - DF-2606 rw stress on the FIXED kernel.
# Mount the patched (keybits=65) image read-write and create 60 files.
# Expected with fix: no Debugger("fubar"), no halt, guest stays alive;
# the corrupt indirect is skipped; new files land in fresh indirects.
# (On the unpatched kernel this same input froze the machine in DDB.)
D=${1:-/root/df2606}
V=${2:-vn2}	# vn2 is attached to h2.img by run.sh on this guest
cd "$D"

mount_hammer2 /dev/${V}@LOCAL /mnt || { echo "MOUNT FAILED"; exit 1; }
echo "MOUNT_OK (rw)"
n=1
while [ $n -le 60 ]; do
	echo "s$n" > /mnt/$(printf "new%02d" $n) || echo "create new$n failed"
	n=$((n+1))
done
echo "LOOP_DONE"
sync
echo "SYNC_DONE"
echo "entries now: $(ls /mnt | wc -l)"
echo "--- kernel messages (fubar/bad bref/CHECK FAIL/panic):"
dmesg | grep -iE "fubar|bad bref|CHECK FAIL|panic" | tail -8
echo "--- nothing above means clean handling"
umount /mnt && echo "UMOUNT_OK"
echo "GUEST_STILL_ALIVE"