CVE-2026-74601: ring-buffer: Use current_context for safe per-CPU buffer swap
In the Linux kernel, the following vulnerability has been resolved:
ring-buffer: Use currentcontext for safe per-CPU buffer swap
The ringbufferswapcpu() function currently checks the per-CPU committing counter to determine if a buffer is actively being written to before performing the swap. However, there exists a race window where this check can be bypassed:
ringbufferlockreserve cpubuffer = buffer->buffers[cpu]; // cpubuffera rbreservenextevent rbstartcommit // inc committing if (unlikely(READONCE(cpubuffer->buffer) != buffer)) {...} rbreservenext rbmovetail rbendcommit(cpubuffer); // dec committing => 0 / interrupt hits here, successfully swaps! / localinc(&cpubuffer->committing);
ringbufferunlockcommit cpubuffer = buffer->buffers[cpu]; // cpubufferb rbcommit rbendcommit RBWARNON(cpubuffer, !localread(&cpubuffer->committing)) // triggers warning
The committing counter can temporarily drop to 0 during a single write operation (within rbmovetail), creating a window where swap can succeed even though the write is still in progress. This leads to inconsistent buffer state and triggers the RBWARNON in rbcommit().
Replace the committing counter check with currentcontext checks, which are set at the entry of ringbufferlockreserve() and remain valid throughout the entire write operation, providing a reliable indicator of buffer busy state during swap.
Affected Software
Event History
Frequently Asked Questions
How can I identify signs that this race has occurred?
The race can leave the per-CPU ring buffer in an inconsistent state and trigger the RB_WARN_ON check in rb_commit().
Are upstream fixes available?
The provided references include stable kernel fixes in commits 5b926fb04cb9ef3156dcf88c69a59d3d1a1c4f9f, 5e6e2a18c20e88167d414f666032792e8bf19b80, and f27bdc43077e4fcb5557dfc315ee8d91e741f483.