milos-linux/kernel/locking
Andrei Vagin 68bcd8b6e0 locking/rwsem: Fix logic error in rwsem_del_waiter()
Commit 1ea4b47350 ("locking/rwsem: Remove the list_head from struct
rw_semaphore") introduced a logic error in rwsem_del_waiter().

The root cause of this issue is an inconsistency in the return values of
__rwsem_del_waiter() and rwsem_del_waiter(). Specifically,
__rwsem_del_waiter() returns true when the wait list becomes empty,
whereas rwsem_del_waiter() is supposed to return true if the wait list
is NOT empty.

This caused a null pointer dereference in rwsem_mark_wake() because it
was being called when sem->first_waiter was NULL.

Fixes: 1ea4b47350 ("locking/rwsem: Remove the list_head from struct rw_semaphore")
Reported-by: syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com
Signed-off-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: syzbot+3d2ff92c67127d337463@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20260314182607.3343346-1-avagin@google.com
2026-03-16 13:16:48 +01:00
..
irqflag-debug.c
lock_events.c
lock_events.h
lock_events_list.h bpf_res_spin_lock 2025-03-30 13:06:27 -07:00
lockdep.c lockdep: Speed up lockdep_unregister_key() with expedited RCU synchronization 2025-07-14 21:57:29 -07:00
lockdep_internals.h locking/lockdep: Change 'static const' variables to enum values 2025-07-14 21:57:29 -07:00
lockdep_proc.c locking/lockdep: Avoid struct return in lock_stats() 2025-07-14 21:57:20 -07:00
lockdep_states.h
locktorture.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
Makefile locking/rwsem: Add context analysis 2026-03-08 11:06:53 +01:00
mcs_spinlock.h locking: Allow obtaining result of arch_mcs_spin_lock_contended 2025-03-19 08:03:04 -07:00
mutex-debug.c locking/mutex: Remove the list_head from struct mutex 2026-03-08 11:06:52 +01:00
mutex.c locking/mutex: Add context analysis 2026-03-08 11:06:53 +01:00
mutex.h locking/mutex: Add context analysis 2026-03-08 11:06:53 +01:00
osq_lock.c locking/osq_lock: Use atomic_try_cmpxchg_release() in osq_unlock() 2024-10-25 10:01:50 +02:00
percpu-rwsem.c locking/percpu-rwsem: add freezable alternative to down_read 2025-04-07 09:37:16 +02:00
qrwlock.c
qspinlock.c locking: Move common qspinlock helpers to a private header 2025-03-19 08:02:29 -07:00
qspinlock.h locking: Move common qspinlock helpers to a private header 2025-03-19 08:02:29 -07:00
qspinlock_paravirt.h locking/pvqspinlock: Convert fields of 'enum vcpu_state' to uppercase 2024-10-17 21:21:16 -07:00
qspinlock_stat.h
rtmutex.c locking/rtmutex: Add context analysis 2026-03-08 11:06:53 +01:00
rtmutex_api.c locking/rtmutex: Add context analysis 2026-03-08 11:06:53 +01:00
rtmutex_common.h locking/rtmutex: Add context analysis 2026-03-08 11:06:53 +01:00
rwbase_rt.c locking/rwsem: Add context analysis 2026-03-08 11:06:53 +01:00
rwsem.c locking/rwsem: Fix logic error in rwsem_del_waiter() 2026-03-16 13:16:48 +01:00
semaphore.c locking/semaphore: Remove the list_head from struct semaphore 2026-03-08 11:06:52 +01:00
spinlock.c locking/spinlocks: Make __raw_* lock ops static 2024-10-07 09:28:35 +02:00
spinlock_debug.c locking/spinlock/debug: Fix data-race in do_raw_write_lock 2025-10-21 12:31:55 +02:00
spinlock_rt.c Scheduler changes for v6.13: 2024-11-19 14:16:06 -08:00
test-ww_mutex.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ww_mutex.h locking/rtmutex: Add context analysis 2026-03-08 11:06:53 +01:00
ww_rt_mutex.c locking/rtmutex: Add context analysis 2026-03-08 11:06:53 +01:00