Thread (8 messages) 8 messages, 3 authors, 2025-01-15

Re: [syzbot] [bpf?] [trace?] WARNING: locking bug in __lock_task_sighand

From: Alexei Starovoitov <hidden>
Date: 2024-12-17 23:50:06
Also in: bpf, lkml

On Mon, Dec 2, 2024 at 4:42 AM Puranjay Mohan [off-list ref] wrote:
Alexei Starovoitov [off-list ref] writes:
quoted
Puranjay, Andrii and All,

looks like if (irqs_disabled()) is not enough.
Should we change it to preemptible() ?

It will likely make it async all the time,
but in this it's an ok trade off?
Yes, as BPF programs can run in all kinds of contexts.

We should replace 'if (irqs_disabled())' with 'if (!preemptible())'

because the definition is:

#define preemptible()   (preempt_count() == 0 && !irqs_disabled())

and we need if ((preempt_count() != 0) || irqs_disabled()), in both
these cases we want to make it async.

I will try to test the fix as Syzbot has now found a reproducer.
Puranjay,

Any progress on a patch ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help