DragonFlyBSD Kernel Audit
DF-0852 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# Run the DF-0852 PoC on the guest.
#
# Expects (set up out-of-band, see README/VERDICT):
#   - the crafted ISO attached to a vnode device (vn0) owned/readable by the caller
#   - vfs.usermount=1 if run as an unprivileged user
#
# Usage: ./run.sh [ssector]
#   default ssector=16  -> demonstrates line-427 overflow (bogus f_blocks)
#   ssector=2147483647 -> demonstrates loop-bound overflow (mount fails, not EINVAL)
set -e
cd "$(dirname "$0")"
SSECTOR="${1:-16}"
echo "+ ./poc /dev/vn0 /tmp/df0852_mnt $SSECTOR"
./poc /dev/vn0 /tmp/df0852_mnt "$SSECTOR"
echo "RUN_EXIT=$?"