mirror-linux/kernel/locking
Waiman Long de4b59d652 locking/lockdep: Add kasan_check_byte() check in lock_acquire()
KASAN instrumentation of lockdep has been disabled, as we don't need
KASAN to check the validity of lockdep internal data structures and
incur unnecessary performance overhead. However, the lockdep_map pointer
passed in externally may not be valid (e.g. use-after-free) and we run
the risk of using garbage data resulting in false lockdep reports.

Add kasan_check_byte() call in lock_acquire() for non kernel core data
object to catch invalid lockdep_map and print out a KASAN report before
any lockdep splat, if any.

Suggested-by: Marco Elver <elver@google.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@gmail.com>
Link: https://lore.kernel.org/r/20250214195242.2480920-1-longman@redhat.com
Link: https://lore.kernel.org/r/20250307232717.1759087-7-boqun.feng@gmail.com
2025-03-08 00:55:04 +01:00
..
Makefile locking/lockdep: Disable KASAN instrumentation of lockdep.c 2025-03-08 00:55:03 +01:00
irqflag-debug.c
lock_events.c
lock_events.h
lock_events_list.h locking/lock_events: Add locking events for lockdep 2025-03-08 00:55:03 +01:00
lockdep.c locking/lockdep: Add kasan_check_byte() check in lock_acquire() 2025-03-08 00:55:04 +01:00
lockdep_internals.h
lockdep_proc.c
lockdep_states.h
locktorture.c
mcs_spinlock.h
mutex-debug.c
mutex.c
mutex.h
osq_lock.c
percpu-rwsem.c
qrwlock.c
qspinlock.c
qspinlock_paravirt.h
qspinlock_stat.h
rtmutex.c locking/lock_events: Add locking events for rtmutex slow paths 2025-03-08 00:55:03 +01:00
rtmutex_api.c
rtmutex_common.h
rwbase_rt.c
rwsem.c
semaphore.c locking/semaphore: Use wake_q to wake up processes outside lock critical section 2025-03-08 00:52:01 +01:00
spinlock.c
spinlock_debug.c
spinlock_rt.c
test-ww_mutex.c
ww_mutex.h
ww_rt_mutex.c