CVE-2026-74666: packet: synchronize pressure clearing with ring reconfiguration
In the Linux kernel, the following vulnerability has been resolved:
packet: synchronize pressure clearing with ring reconfiguration
packetsetring() updates the RX ring state under skreceivequeue.lock, but used to publish the tpacket receive mode through po->prothook.func after releasing that lock. packetpoll() and packetrecvmsg() can then run the pressure clearing path after the ring has been cleared while still seeing tpacketrcv, causing packetrcvhasroom() to dereference stale or NULL ring storage.
Move the existing receive hook assignment into the same skreceivequeue.lock section as the ring state update. Keep the assignment otherwise unchanged, including on TX ring reconfiguration, to avoid adding behavior changes that are not required for the fix.
Serialize packetrecvmsg() pressure clearing with the same queue lock only after PACKETSOCKPRESSURE has been observed. If the flag is clear and the socket has moved away from tpacketrcv, packetsetring() has already detached the socket and waited for synchronizenet(), so no new packet input can set the flag again.
packetpoll() already holds skreceivequeue.lock, so it uses the new unlocked helper directly.