⬢ DragonFlyBSD Kernel Audit
DF-2606 / stress.sh
← back to finding ↓ download raw
#!/bin/sh
# stress.sh - DF-2606 rw stress: mount the PATCHED image read-write and
# create one file.  On the unpatched kernel this drives
# hammer2_chain_indkey_dir() over the keybits=65 entry:
#   hammer2_chain.c:4719  key_next = bref->key + (1 << 65)      [UB shift]
#   hammer2_chain.c:4728  if (bref->keybits > 64) kprintf("bad bref ...")
#   hammer2_chain.c:4731  Debugger("fubar")                    [halts in DDB]
# The guest FREEZES at the db> prompt (ssh dies).  Capture the serial
# console afterwards with:  vm.sh log 200 > serial-hang.log
#
# WARNING: wedges the guest until vm.sh reset.
D=${1:-/root/df2606}
cd "$D"
vnconfig -c vn0 h2.img
mount_hammer2 /dev/vn0@LOCAL /mnt
echo stress1 > /mnt/newfile1 &
sleep 5
echo "guest should now be frozen (this line normally never prints)"