posix-timers: Ensure timer ID search-loop limit is valid
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 5ed67f05f66c41e39880a6d61358438a25f9fee5 · < 6a0ac84501b4fec73a1a823c55cf13584c43f418| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
posix-timers: Ensure timer ID search-loop limit is valid
posix_timer_add() tries to allocate a posix timer ID by starting from the cached ID which was stored by the last successful allocation.
This is done in a loop searching the ID space for a free slot one by one. The loop has to terminate when the search wrapped around to the starting point.
But that's racy vs. establishing the starting point. That is read out lockless, which leads to the following problem:
CPU0 CPU1 posix_timer_add() start = sig->posix_timer_id; lock(hash_lock); ... posix_timer_add() if (++sig->posix_timer_id < 0) start = sig->posix_timer_id; sig->posix_timer_id = 0;
So CPU1 can observe a negative start value, i.e. -1, and the loop break never happens because the condition can never be true:
if (sig->posix_timer_id == start) break;
From the CVE record · Linux
A race in the Linux kernel's POSIX timer ID allocation can let a concurrent allocation observe a negative starting ID, preventing the search loop from stopping at its intended limit. This can cause a prolonged search; the input does not establish an attacker path, authentication requirement, or user-interaction requirement.
Engineers running Linux kernels should check whether their kernel includes the POSIX timer fix; affected versions are not specified.