In the Linux kernel, the following vulnerability has been resolved: slab: fix kmallocnolock() context check for PREEMPTRT On PREEMPTRT kernels, locallock becomes a sleeping lock. The current check in kmallocnolock() only verifies we're not in NMI or hard IRQ context, but misses the case where preemption is disabled. When a BPF program runs from a tracepoint with preemption disabled (preemptcount > 0), kmallocnolock() proceeds to call locallockirqsave() which attempts to acquire a sleeping lock, triggering: BUG: sleeping function called from invalid context inatomic(): 1, irqsdisabled(): 0, nonblock: 0, pid: 6128 preemptcount: 2, expected: 0 Fix this by checking !preemptible() on PREEMPTRT, which directly expresses the constraint that we cannot take a sleeping lock when preemption is disabled. This encompasses the previous checks for NMI and hard IRQ contexts while also catching cases where preemption is disabled.