lkml.org 
[lkml]   [2024]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [syzbot] [bpf?] [trace?] WARNING: locking bug in __lock_task_sighand
Date
Alexei Starovoitov <alexei.starovoitov@gmail.com> writes:

> 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.

Thanks,
Puranjay
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2024-12-02 14:18    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog