In the Linux kernel, the following vulnerability has been resolved:
tipc: avoid busy looping in tipcexitnet()
Blamed commit introduced a busy-wait loop in tipcexitnet() to wait for pending UDP bearer cleanup works to complete:
while (atomic_read(&tn->wq_count))
cond_resched();
This loop can busy-wait for a long time if condresched() is a NOP. This typically happens if the netns exit is executed by a high priority task, or under kernels configured without preemption (CONFIGPREEMPT_NONE). In such cases, it wastes CPU cycles and can lead to soft lockups.
Fix this by replacing the busy loop with waitvarevent(), allowing the thread to sleep properly until the work queue count reaches zero.
Accordingly, update cleanupbearer() to use atomicdecandtest() and wakeupvar() to wake up the waiter when the count drops to zero.
This uses the global wait queue hash table, avoiding the need to bloat struct tipcnet with a waitqueueheadt. The atomicdecand_test() provides the necessary memory barrier to ensure the wakeup is not missed.