rtmutex: Use waiter::task instead of current in remove_waiter()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8161239a8bcce9ad6b537c04a1fa3b5c68bae693 · < 3fb7394a837740770f0d6b4b30567e60786a63f2| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
rtmutex: Use waiter::task instead of current in remove_waiter()
remove_waiter() is used by the slowlock paths, but it is also used for proxy-lock rollback in rt_mutex_start_proxy_lock() when invoked from futex_requeue().
In the latter case waiter::task is not current, but remove_waiter() operates on current for the dequeue operation. That results in several problems:
1) the rbtree dequeue happens without waiter::task::pi_lock being held
2) the waiter task's pi_blocked_on state is not cleared, which leaves a dangling pointer primed for UAF around.
3) rt_mutex_adjust_prio_chain() operates on the wrong top priority waiter task
Use waiter::task instead of current in all related operations in remove_waiter() to cure those problems.
From the CVE record · Linux
The Linux kernel’s rtmutex remove_waiter() function uses the current task instead of the waiter task during proxy-lock rollback from futex_requeue(). This can leave a dangling pointer that may lead to use-after-free; the input does not specify attacker access, authentication, or user-interaction requirements.
Engineers running the Linux kernel should check their installations; affected versions are not specified.