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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> writes:

> On Tue, Dec 17, 2024 at 3:49 PM Alexei Starovoitov
> <alexei.starovoitov@xxxxxxxxx> wrote:
>>
>> On Mon, Dec 2, 2024 at 4:42 AM Puranjay Mohan <puranjay@xxxxxxxxxx> wrote:
>> >
>> > Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> 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.
>>
>> Puranjay,
>>
>> Any progress on a patch ?
>
> ping.

Hi Alexei,
Sorry for being AWOL. I was on a long vacation in India and just got
back.

Here is the patch to fix this: https://lore.kernel.org/all/20250115103647.38487-1-puranjay@xxxxxxxxxx/

Thanks,
Puranjay

#syz test: https://github.com/puranjaymohan/bpf.git bpf_preemt_fix

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux