โฌข DragonFlyBSD Kernel Audit
DF-4939 / run.log
โ† back to finding โ†“ download raw
DF-4939 run.log โ€” full transcript of the decisive runs (guest ssh, root)
=========================================================================

[setup: load virtual i2c stack โ€” see build.log for harness compile]
# kldload /root/harness/lpbbfake.ko && kldload iicbb && kldload iicbus && kldload if_ic
kldload: can't load iicbus: module already loaded or in kernel
        (auto-loaded as MODULE_DEPEND of iicbb; if_ic auto-loaded by newbus
         child name resolution โ€” dmesg below)
# kldstat | grep -E "lpbb|iic|ic"
 5    1 0xffffffff82600000    15000 if_ic.ko
 6    2 0xffffffff82615000    1f000 iicbus.ko
 7    1 0xffffffff82634000     1000 lpbbfake.ko
 8    1 0xffffffff82635000    18000 iicbb.ko
# dmesg | grep -iE "^(ic|lpbb|iic)"
lpbb0: <virtual I2C bit-bang bridge (lpbbfake)> on isa0
lpbb1: <virtual I2C bit-bang bridge (lpbbfake)> on isa1
iicbb0: <I2C bit-banging driver> on lpbb0
iicbus0: <Philips I2C bus> on iicbb0 addr 0xff
ic0 on iicbus0
iicbb1: <I2C bit-banging driver> on lpbb1
iicbus1: <Philips I2C bus> on iicbb1 addr 0xff
ic1 on iicbus1

[configure โ€” NOTE: ic is IFF_POINTOPOINT, dest addr required]
# ifconfig ic0 10.99.99.1 10.99.99.2 netmask 255.255.255.252 up
# ifconfig ic0 | head -1
ic0: flags=808851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST,PROXY> metric 0 mtu 1500

[baseline]
# vmstat -m | grep -i devbuf
             devbuf     219    214K       0    390M      232

[200 down/up cycles โ€” UNFIXED kernel]
# i=0; while [ $i -lt 200 ]; do ifconfig ic0 down; ifconfig ic0 up; i=$((i+1)); done; echo CYCLES-DONE
CYCLES-DONE
# vmstat -m | grep -i devbuf
             devbuf     619    814K       0    390M      632
  -> +400 allocations / +600K  == 2 x (1500+4) B leaked per cycle

[+100 more cycles โ€” determinism check]
# i=0; while [ $i -lt 100 ]; do ifconfig ic0 down; ifconfig ic0 up; i=$((i+1)); done
# vmstat -m | grep -i devbuf
             devbuf     819   1.09M       0    390M      832
  -> +200 allocations / +300K  (300/300 cycles leaked; deterministic)

=========================================================================
FIX VALIDATION (patched if_ic.ko built from fix.diff applied to guest
/usr/src copy โ€” build.log.fix; rebooted into patched module)
=========================================================================
# ifconfig ic0 10.99.99.1 10.99.99.2 netmask 255.255.255.252 up
ic0: flags=808851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST,PROXY> metric 0 mtu 1500
# vmstat -m | grep -i devbuf
             devbuf     219    214K       0    390M      232
# i=0; while [ $i -lt 200 ]; do ifconfig ic0 down; ifconfig ic0 up; i=$((i+1)); done; echo FIX-CYCLES-DONE
FIX-CYCLES-DONE
# vmstat -m | grep -i devbuf
             devbuf     219    214K       0    390M      232
  -> BYTE-FLAT across the same 200 cycles: leak eliminated (baseline
     unfixed run: +400 allocs / +600K). Bad behavior GONE on patched module.