⬢ DragonFlyBSD Kernel Audit
DF-3642 / trace.sh
← back to finding ↓ download raw
#!/bin/sh
# DF-3642 source-trace reproduction: erase-bank retry accumulation
# Regenerates trace.log from the repo. Run from the repo root:
#   sh findings/poc/DF-3642/trace.sh > findings/poc/DF-3642/trace.log
F=sys/dev/netif/ig_hal/e1000_ich8lan.c
E=sys/dev/netif/em/if_em.c
A=sys/dev/netif/ig_hal/e1000_api.c

echo "== DF-3642 trace: erase-bank retry accumulation =="
echo "-- base setup ($F:4742-4745)"
sed -n '4742,4745p' $F
echo "-- accumulation inside retry loop (4779-4781) + retry budget (4798) + unconditional success (4801)"
sed -n '4775,4801p' $F
echo
echo "-- reachability chain --"
echo "[1] $E:781/787 attach calls e1000_validate_nvm_checksum"
sed -n '781,788p' $E
echo "[2] $A:1270 dispatch to nvm.ops.validate"
sed -n '1270,1272p' $A
echo "[3] $F:4395-4403 VALID_CSUM clear -> write+update (bank erase)"
sed -n '4395,4403p' $F
echo "[4] $F:4243-4254 update -> e1000_erase_flash_bank_ich8lan"
sed -n '4243,4254p' $F
echo
echo "-- upstream check: FreeBSD HEAD still identical --"
curl -s --max-time 30 \
  https://raw.githubusercontent.com/freebsd/freebsd-src/main/sys/dev/e1000/e1000_ich8lan.c \
  | grep -n "flash_linear_addr += (j \* sector_size);" \
  || echo "FETCH FAILED (check manually)"