⬢ DragonFlyBSD Kernel Audit
DF-5632 / run_a_stock.sh
← back to finding ↓ download raw
#!/bin/sh
# RUN-A2: STOCK iicbus.ko baseline (non-destructive).
# NOTE: 'addchild' is deliberately NOT run here -- on stock kernels
# BUS_ADD_CHILD through iicbus's bus_add_child method is an
# out-of-bounds write (devclass_add_device negative-index) and panics
# the guest; see panic_skew_stock.txt / panic_skew_addchild.txt.
# Witness targets: DF-5633 (trio re-creation on re-attach),
# DF-5634 (ivar absent, stock).
set -e
cd /root/df5632

echo "=== load stock chain (iicbus.ko from /boot/kernel) ==="
kldload /boot/kernel/iicbus.ko
kldload /boot/kernel/iicbb.ko
kldload /usr/obj/root/df5632/build_reg/iicbb_reg.ko
kldload /usr/obj/root/df5632/build_rig/df5632_rig.ko
sleep 1
dmesg | tail -8

echo "=== stat ==="
./dfctl stat
echo "=== ivar round trip (stock: ENXIO, value untouched) ==="
./dfctl ivar
echo "=== cycle 2 detach+reattach (witness trio re-creation: 3 -> 9) ==="
./dfctl cycle 2
echo "=== final stat ==="
./dfctl stat
echo "=== kldunload everything (clean teardown for next run) ==="
kldunload df5632_rig
kldunload iicbb_reg
kldunload iicbb
kldunload iicbus
sleep 1
kldstat | tail -5
echo RUN-A2-DONE