DragonFlyBSD Kernel Audit
DF-0108 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0108 run script
# REQUIRES: root or operator group (device node is root:operator 0640).
# Creates a scratch vnode-backed disk so the boot disk is never touched.
# On the unpatched GENERIC kernel this PANICS (KKASSERT at subr_disklabel32.c:336).
# On the fixed kernel it returns EINVAL and the guest stays up.
cd "$(dirname "$0")"
echo "[setup] scratch vn device on /dev/vn0"
rm -f /root/scratch.img
dd if=/dev/zero of=/root/scratch.img bs=1m count=64 status=none
vnconfig -c -s labels /dev/vn0 /root/scratch.img 2>/dev/null || vnconfig -c -s labels vn0 /root/scratch.img
ls -l /dev/vn0s0
echo "[run] ./poc_secsize /dev/vn0s0"
./poc_secsize /dev/vn0s0
echo "PoC_EXIT=$?"