diff options
author | 2025-01-26 11:32:43 +0800 | |
---|---|---|
committer | 2025-02-21 20:19:12 +0100 | |
commit | 337369f8ce9e20226402cf139c4f0d3ada7d1705 (patch) | |
tree | 5f9bcd8033065b5b3d21076287d2366d23d6b497 /scripts/generate_rust_analyzer.py | |
parent | x86/locking: Use asm_inline for {,try_}cmpxchg{64,128} emulations (diff) | |
download | wireguard-linux-337369f8ce9e20226402cf139c4f0d3ada7d1705.tar.xz wireguard-linux-337369f8ce9e20226402cf139c4f0d3ada7d1705.zip |
locking/mutex: Add MUTEX_WARN_ON() into fast path
Scenario: In platform_device_register, the driver misuses struct
device as platform_data, making kmemdup duplicate a device. Accessing
the duplicate may cause list corruption due to its mutex magic or list
holding old content.
It recurs randomly as the first mutex - getting process skips the slow
path and mutex check. Adding MUTEX_WARN_ON(lock->magic!= lock) in
__mutex_trylock_fast() makes it always happen.
Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20250126033243.53069-1-cuiyunhui@bytedance.com
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions