⬢ DragonFlyBSD Kernel Audit
DF-2420 / flood2.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-2420 live-hardware exhaustion attempt (negative-control churn):
# sustained concurrent I/O against the real ahci-attached disk, plus a
# concurrent pass(4) XPT_SCSI_IO storm, watching for the missing-NULL-check
# path (ahci_ata_get_xfer() == NULL) to fire.
LOG=/root/flood2.log
: > $LOG
echo "=== flood2 start $(date +%T)" >> $LOG
for i in $(seq 1 48); do
	(dd if=/dev/da0 of=/dev/null bs=1m 2>>$LOG; echo "dd$i rc=$?" >> $LOG) &
done
pids=$(jobs -p)
# pass-CCB storm: continuous READ_10s while the dd's run
( end=$(( $(date +%s) + 60 )); n=0
  while [ $(date +%s) -lt $end ]; do
	/root/ahcipoc read10 >/dev/null 2>&1
	n=$((n+1))
  done
  echo "passstorm ccb count: $n" >> $LOG ) &
pids="$pids $(jobs -p | tail -1)"
wait $pids 2>/dev/null
echo "=== flood2 done $(date +%T) survivors: $(grep -c 'rc=0' $LOG)" >> $LOG
uptime >> $LOG