DragonFlyBSD Kernel Audit
DF-0744 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# Run the DF-0744 triggers (corruption + leak) end-to-end.
# Must be run as the unprivileged user (maxx). Requires IPv6 loopback.
set -u
cd "$(dirname "$0")"

echo "================== DF-0744 TEST 1: sticky-option corruption =================="
./corrupt
echo "corrupt exit=$?"

echo ""
echo "================== DF-0744 TEST 2: per-call M_IP6OPT leak =================="
echo "--- baseline: ip6opt slab (vmstat -m) ---"
vmstat -m 2>&1 | awk '/^[[:space:]]*ip6opt[[:space:]]/ {print "before:",$0; found=1} END{if(!found)print "before: ip6opt  0   0  ...  (none yet)"}'

N=4000
./leak $N
echo "leak exit=$?"

echo "--- after: ip6opt slab (vmstat -m) ---"
vmstat -m 2>&1 | awk '/^[[:space:]]*ip6opt[[:space:]]/ {print "after: ",$0; found=1} END{if(!found)print "after:  ip6opt  0   0  ...  (none yet)"}'

echo ""
echo "(If ip6opt Count grew by ~$N (== leaked struct in6_pkt_info per call), the leak reproduced.)"