Description
In the Linux kernel, the following vulnerability has been resolved: locking/rtmutex: Skip remove_waiter() when waiter is not enqueued syzbot triggered the following splat in remove_waiter() via FUTEX_CMP_REQUEUE_PI: KASAN: null-ptr-deref in range [0x0000000000000a88-0x0000000000000a8f] class_raw_spinlock_constructor remove_waiter+0x159/0x1200 kernel/locking/rtmutex.c:1561 rt_mutex_start_proxy_lock+0x103/0x120 futex_requeue+0x10e4/0x20d0 __x64_sys_futex+0x34f/0x4d0 task_blocks_on_rt_mutex() does not arm the waiter upon deadlock detection, leaving waiter->task nil, where 3bfdc63936dd ("rtmutex: Use waiter::task instead of current in remove_waiter()") made this fatal. Furthermore, rt_mutex_start_proxy_lock() should not be calling into remove_waiter() upon a successfully grabbing the rtmutex. 1a1fb985f2e2 ("futex: Handle early deadlock return correctly"), moved the remove_waiter() out of __rt_mutex_start_proxy_lock() (where 'ret' was only ever 0 or < 0) into the wrapper. Tighten this check to account for try_to_take_rt_mutex().
Affected products
- Linux / Linux3fb7394a837740770f0d6b4b30567e60786a63f2 – a388e3dfaf9538a680de5ed43a8ebb5dd45b6e53
- Linux / Linux88614876370aac8ad1050ad785a4c095ba17ac11 – 55363fa0a04524d11efeaadee734d2db1756ed27
- Linux / Linux3bfdc63936dd4773109b7b8c280c0f3b5ae7d349 – 40a25d59e85b3c8709ac2424d44f65610467871e
- Linux / Linuxd8cce4773c2b23d819baf5abedc62f7b430e8745 – d8cce4773c2b23d819baf5abedc62f7b430e8745
- Linux / Linux8a1fc8d698ac5e5916e3082a0f74450d71f9611f – 8a1fc8d698ac5e5916e3082a0f74450d71f9611f
- Linux / Linux6d52dfcb2a5db86e346cf51f8fcf2071b8085166 – 6d52dfcb2a5db86e346cf51f8fcf2071b8085166
- Linux / Linux6.1.175 – 6.2
- Linux / Linux6.6.140 – 6.7
- Linux / Linux6.12.86 – 6.13
- Linux / Linux6.18.27 – 6.18.36
- Linux / Linux7.0.4 – 7.0.13