⬢ DragonFlyBSD Kernel Audit
DF-3077 / phase_hammer3077.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-3077: blockmap next_offset foreign zone -> KKASSERT on first alloc
kldload hammer 2>/dev/null
dd if=/dev/zero of=/root/h77.img bs=1m count=1024 2>/dev/null
/root/v30/vntool detach 4 2>/dev/null
dd if=/dev/vn of=/dev/null bs=512 count=0 2>/dev/null   # ensure unit exists
dd if=/dev/vn of=/dev/null bs=512 count=0 2>/dev/null
/root/v30/vntool attach 4 /root/h77.img || exit 1
newfs_hammer -L test77 -f /dev/vn4 >/dev/null 2>&1 && echo NEWFS_OK || newfs_hammer -L test77 -f /dev/vn4 2>&1 | tail -3
/root/v30/craft_3077 /root/h77.img || exit 1
mkdir -p /mnt/h77
mount -t hammer /dev/vn4 /mnt/h77 && echo HAMMER_MOUNT_OK || { echo MOUNT_FAIL; exit 1; }
echo "=== DF-3077 first data write start $(date)"
echo data > /mnt/h77/f
sync
echo "=== DF-3077 ended (no panic if you see this)"