⬢ DragonFlyBSD Kernel Audit
DF-3680 / trigger.c
← back to finding ↓ download raw
/*
 * DF-3680 trigger (source-level; requires igb(4) hardware).
 *
 * The unvalidated value is the TX-head write-back buffer (txr->tx_hdr),
 * DMA-written by the NIC. On hardware:
 *
 *   1. ifconfig igb0 up; push TX traffic so descriptors pend.
 *   2. Corrupt the write-back word to a value >= num_tx_desc (or >= 2^31),
 *      e.g. via device fault injection or a compromised device, then raise
 *      a TX interrupt.
 *   3. igb_msix_tx/igb_intr -> igb_tx_intr(txr, *(txr->tx_hdr))
 *      -> igb_txeof() spins forever on `while (first != hdr)`:
 *        - INVARIANTS kernel: KKASSERT(avail < num_tx_desc) at :2189 panics
 *          after one ring wrap.
 *        - production kernel: permanent spin holding tx_serialize (hang).
 *
 * Sinks:
 *   sys/dev/netif/igb/if_igb.c:2186  while (first != hdr)        [txeof]
 *   sys/dev/netif/igb/if_igb.c:2239  while (first != hdr)        [txgc]
 *   callers feeding *(txr->tx_hdr): :3361 :3454 :3516 :4737 :4938
 *
 * The QEMU audit guest has no igb NIC; run.sh proves module presence and
 * device absence. Nothing here is executable without the device.
 */
int main(void) { return 0; }