DragonFlyBSD Kernel Audit
DF-2627 / fix_validate.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2627 fix validation (guest): re-run the exact PoC battery on kernel #1.
cd /root/poc/df2627
sh /root/poc/df2627/run_guest.sh  > /root/poc/df2627/fix_run_guest.log 2>&1
sh /root/poc/df2627/run_guest2.sh > /root/poc/df2627/fix_run_guest2.log 2>&1
echo "=== cookie distribution on FIXED kernel (corrupt image) ==="
cat /root/poc/df2627/fix_run_guest.log /root/poc/df2627/fix_run_guest2.log |
    grep cookie | grep -o 'cookie=0x[0-9a-f]*' | sort | uniq -c
echo "=== rc/errno distribution ==="
cat /root/poc/df2627/fix_run_guest.log /root/poc/df2627/fix_run_guest2.log |
    grep '^sample' | grep -o 'errno=[0-9]*' | sort | uniq -c
echo "=== sample count ==="
cat /root/poc/df2627/fix_run_guest.log /root/poc/df2627/fix_run_guest2.log |
    grep -c '^sample'
echo "=== control image: listing must still work ==="
umount /mnt/h2x && vnconfig -u vn0
vnconfig -c vn0 /root/poc/df2627/base2627.img
mount -t hammer2 /dev/vn0@testvol /mnt/h2x
ls /mnt/h2x | wc -l
/root/poc/df2627/leak_df2627 /mnt/h2x 5 n
umount /mnt/h2x && vnconfig -u vn0
echo FIX_VALIDATION_DONE