freenode
Kernel & Low-Level

Linux CoDel fix stops a tiny interval from soft-locking the kernel

A backport forces CoDel's drop schedule to advance and caps drops per dequeue, closing an unprivileged soft lockup in codel and fq_codel.

Linux maintainers have backported a fix for a soft lockup in the CoDel queueing code, including fq_codel, that an unprivileged user can trigger with ordinary traffic-control settings.

CoDel spaces packet drops using a control law based on the configured interval. When that interval is tiny, the time until the next drop rounds down to zero. Dequeue then never advances and, still holding the queueing-discipline lock, drains the entire backlog in one call. The machine reports a soft lockup.

Jamal Hadi Salim's fix, reported by Vega, makes each control-law step at least one timer tick and stops after 256 drops in a single dequeue. If that cap is hit, the next drop is rescheduled from the current time. That is a deliberate change after long idle gaps, when the owed catch-up grows with both the gap and the backlog and no interval floor can bound it. The configured target delay is left unchecked: a sub-tick target is aggressive, not a deadlock.

The same cap covers fq_codel and the Wi-Fi transmit-queue path, where the interval is fixed. A reproduction puts a 1 kbit token-bucket filter in front of CoDel with a 2 microsecond interval and floods UDP; unpatched kernels accept the setup and lock up, while patched kernels drop at most 256 packets per call.