DragonFlyBSD Kernel Audit
DF-0037 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0037 run script (unprivileged)
# Demonstrates the cross-session pgid/sid info leak.
# - leak_xsess: parent + child in DIFFERENT sessions; parent probes child.
#     Bug present -> "BUG DF-0037 REPRODUCED" + errno=0
#     Fixed       -> "FIXED: ... EPERM"           + errno=1 (EPERM)
# - leak_pgid:   scan pids 1..100000; bug enumerates every process on the
#     box, fix enumerates only those in the caller's own session.
cd "$(dirname "$0")"
echo "=== leak_xsess (definitive cross-session test) ==="
./leak_xsess
echo "rc=$?"
echo
echo "=== leak_pgid (system-wide enumeration count) ==="
./leak_pgid | tail -3