⬢ DragonFlyBSD Kernel Audit
DF-4928 / trigger.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-4928 - live trigger on the DragonFly audit guest (run as root).
# Demonstrates the corepower_probe() gating fall-through on a non-family-6
# "Intel" CPU (QEMU TCG reports Family=0xf, Model=0x6b):
#   - probe PASSES (only the rdmsr_safe(MSR_RAPL_POWER_UNIT) test gates it,
#     because the `if (cpu_family == 0x06)` model check is a skip-guard,
#     not a reject)
#   - attach runs and executes the raw rdmsr() at corepower.c:273
#   - attach then returns ENXIO (sc_have_sens == 0) - benign here
# No sensors attach; no #GP; kldunload clean; guest stays up.
set -e
echo "== CPU =="
grep -E "^CPU:|Origin" /var/run/dmesg.boot | head -3
sysctl hw.model hw.sensors.dev_idmax
echo "== load =="
kldload corepower
kldstat -v | grep -i corepower || true
echo "== dmesg after load =="
dmesg | tail -6
echo "== sensors =="
sysctl hw.sensors | grep -v dev_idmax || echo "(no sensors - as expected)"
echo "== unload =="
kldunload corepower
echo "== alive =="
uptime
echo "TRIGGER_DONE"