Description
In the Linux kernel, the following vulnerability has been resolved: net: serialize netif_running() check in enqueue_to_backlog() Syzbot reported a KASAN slab-use-after-free in fib_rules_lookup(). The root cause is a race condition where packets can escape the backlog flushing during device unregistration (e.g., during netns exit). Commit e9e4dd3267d0 ("net: do not process device backlog during unregistration") introduced a lockless netif_running() check in enqueue_to_backlog() to prevent queuing packets to an unregistering device. However, this creates a TOCTOU race window. A lockless transmitter (like veth_xmit) can pass the check before dev_close() clears IFF_UP. If the transmitter is then delayed, flush_all_backlogs() can run and finish before the transmitter grabs the backlog lock and queues the packet. The packet then escapes the flush and triggers UAF later when processed. Fix this by moving the netif_running() check inside the backlog lock. This serializes the check with the flush work (which also grabs the lock). We then either queue the packet before the flush runs (so it gets flushed), or check netif_running() after the flush/close completes (so it gets dropped).
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
e9e4dd3267d0c5234c5c0f47440456b10875dec9 to < cbe10ea090ea9d6fa5ff50c9b44f2a86fe56f0b7affectede9e4dd3267d0c5234c5c0f47440456b10875dec9 to < b422e3eff0edf0975de4883929adbed28f9d08bcaffectede9e4dd3267d0c5234c5c0f47440456b10875dec9 to < 2fface6e0bbd6314d1d9d071abf2c4d67548511caffectede9e4dd3267d0c5234c5c0f47440456b10875dec9 to < 46762cefe7f4e5bffc1eb467810a7bbb02e461d7affected78b6803a1961369d0b8350ff1f99b7375bbd7a8faffectedb5d73d9cdd6be22795499890ea928a6f57ef829caffectedf6533fed1bfa842e391ee50f9a9c5e963c71e579affected2095ab2456da766174cda8bc105d7a7b1bc70e16affectedf1fdb184aefa8447560e3ea0e605171592ffee41affectedf75c8a3015422128ca150e81c730bc2a471b5f4aaffected3.2.71 to < 3.3affected3.4.111 to < 3.5affected3.12.48 to < 3.13affected3.14.54 to < 3.15affected3.18.22 to < 3.19affected4.1.9 to < 4.2affected
Linux Linux
Default version status: affected
4.2affected0 to < 4.2unaffected6.12.114 to ≤ 6.12.*unaffected6.18.57 to ≤ 6.18.*unaffected7.1.5 to ≤ 7.1.*unaffected7.2 to ≤ *unaffected