CVE-2024-40980 Information
Description
In the Linux kernel the following vulnerability has been resolved:
drop_monitor: replace spin_lock by raw_spin_lock
trace_drop_common() is called with preemption disabled and it acquires a spin_lock. This is problematic for RT kernels because spin_locks are sleeping locks in this configuration which causes the following splat:
BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
in_atomic(): 1 irqs_disabled(): 1 non_block: 0 pid: 449 name: rcuc/47
preempt_count: 1 expected: 0
RCU nest depth: 2 expected: 2
5 locks held by rcuc/47/449:
0: ff1100086ec30a60 ((softirq_ctrl.lock))+.+.-2:2 at: __local_bh_disable_ip+0x105/0x210
1: ffffffffb394a280 (rcu_read_lock)….-1:2 at: rt_spin_lock+0xbf/0x130
2: ffffffffb394a280 (rcu_read_lock)….-1:2 at: __local_bh_disable_ip+0x11c/0x210
3: ffffffffb394a160 (rcu_callback)….-0:0 at: rcu_do_batch+0x360/0xc70
4: ff1100086ee07520 (&data->lock)+.+.-2:2 at: trace_drop_common.constprop.0+0xb5/0x290
irq event stamp: 139909
hardirqs last enabled at (139908): [
trace_drop_common() also disables interrupts but this is a minor issue because we could easily replace it with a local_lock.
Replace the spin_lock with raw_spin_lock to avoid sleeping in atomic context.
Reference
https://git.kernel.org/stable/c/594e47957f3fe034645e6885393ce96c12286334 https://git.kernel.org/stable/c/96941f29ebcc1e9cbf570dc903f30374909562f5 https://git.kernel.org/stable/c/b3722fb69468693555f531cddda5c30444726dac https://git.kernel.org/stable/c/f251ccef1d864790e5253386e95544420b7cd8f3 https://git.kernel.org/stable/c/76ce2f9125244e1708d29c1d3f9d1d50b347bda0 https://git.kernel.org/stable/c/07ea878684dfb78a9d4f564c39d07e855a9e242e https://git.kernel.org/stable/c/f1e197a665c2148ebc25fe09c53689e60afea195
Share on: