⬢ DragonFlyBSD Kernel Audit
DF-3348 / lagg_race.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-3348: unlocked lagg_sysctl_active walk vs lagg_port_destroy
cd /root/vb
ifconfig tap0 create 2>/dev/null; ifconfig tap0 up
ifconfig lagg0 destroy 2>/dev/null
ifconfig lagg0 create; ifconfig lagg0 laggproto lacp; ifconfig lagg0 up
SYSCTL=$(sysctl -aN 2>/dev/null | grep -E "lagg.*active" | head -1)
echo "sysctl: $SYSCTL"
( i=0; while [ $i -lt 4000 ]; do sysctl $SYSCTL >/dev/null 2>&1; i=$((i+1)); done ) &
R=$!
i=0
while [ $i -lt 300 ]; do
	ifconfig lagg0 laggport tap0 >/dev/null 2>&1
	ifconfig lagg0 -laggport tap0 >/dev/null 2>&1
	i=$((i+1))
done
wait $R
echo "lagg sysctl race done (no crash = not hit)"
ifconfig lagg0 destroy