DragonFlyBSD Kernel Audit
DF-0941 / run.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-0941 run script. The sysctl write requires root (PRIV_SYSCTL_WRITE).
# On the UNPATCHED kernel this panics with a divide-by-zero in vm_get_pg_color.
# On the FIXED kernel the sysctl is read-only and the write is rejected (rc=1).
#
# Usage:  sh run.sh        (run as root on the guest)
set -e
echo "[*] before:"; sysctl hw.cpu_topology_phys_ids hw.cpu_topology_core_ids hw.cpu_topology_ht_ids
echo "[*] attempting sysctl hw.cpu_topology_phys_ids=0 (variant A: phys_ids=0 -> div0 at vm_page.c:1225):"
sysctl hw.cpu_topology_phys_ids=0
echo "[*] if you see this line, the kernel did NOT panic (sysctl rejected on fixed kernel)."