android_kernel_motorola_sm6375/kernel/locking
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Davidlohr Bueso 2ec0afec5c
BACKPORT: 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. 1a1fb985f2 ("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().

Fixes: 3bfdc63936dd ("rtmutex: Use waiter::task instead of current in remove_waiter()")
Change-Id: Ib19a2f223ba67d20496c0ae95096747f5350c520
Reported-by: [email protected]
Signed-off-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Cc: [email protected]
Closes: https://lore.kernel.org/all/[email protected]/
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
2026-07-29 03:30:48 +06:00
..
lock_events.c
lock_events.h
lock_events_list.h
lockdep.c locking/lockdep: Decrease nr_unused_locks if lock unused in zap_class() 2025-05-02 07:39:15 +02:00
lockdep_internals.h locking/lockdep: Decrement IRQ context counters when removing lock chain 2020-10-01 13:17:33 +02:00
lockdep_proc.c locking/lockdep: Fix overflow in presentation of average lock-time 2020-09-03 11:26:47 +02:00
lockdep_states.h
locktorture.c locktorture: Print ratio of acquisitions, not failures 2020-04-23 10:36:44 +02:00
Makefile
mcs_spinlock.h
mutex-debug.c locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 12:05:15 +02:00
mutex-debug.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 12:05:15 +02:00
mutex.c This is the 5.4.146 stable release 2021-09-15 14:01:16 +02:00
mutex.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 12:05:15 +02:00
osq_lock.c
percpu-rwsem.c
qrwlock.c locking/qrwlock: Fix ordering in queued_write_lock_slowpath() 2021-04-28 13:19:14 +02:00
qspinlock.c
qspinlock_paravirt.h
qspinlock_stat.h
rtmutex-debug.c
rtmutex-debug.h
rtmutex.c BACKPORT: locking/rtmutex: Skip remove_waiter() when waiter is not enqueued 2026-07-29 03:30:48 +06:00
rtmutex.h
rtmutex_common.h rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:54:09 +01:00
rwsem.c Revert "rwsem: Implement down_read_killable_nested" 2021-01-11 14:47:10 +01:00
rwsem.h
semaphore.c locking/semaphore: Use wake_q to wake up processes outside lock critical section 2025-04-10 14:29:42 +02:00
spinlock.c
spinlock_debug.c soc: qcom: Create framework for qcom watchdogs 2020-08-18 12:17:42 -07:00
test-ww_mutex.c locking/ww_mutex/test: Fix potential workqueue corruption 2023-11-28 16:50:13 +00:00