lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mb61p5xmgicov.fsf@kernel.org>
Date: Wed, 15 Jan 2025 10:38:56 +0000
From: Puranjay Mohan <puranjay@...nel.org>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: syzbot <syzbot+97da3d7e0112d59971de@...kaller.appspotmail.com>, Andrii
 Nakryiko <andrii@...nel.org>, Alexei Starovoitov <ast@...nel.org>, bpf
 <bpf@...r.kernel.org>, Daniel Borkmann <daniel@...earbox.net>, Eddy Z
 <eddyz87@...il.com>, Hao Luo <haoluo@...gle.com>, John Fastabend
 <john.fastabend@...il.com>, Jiri Olsa <jolsa@...nel.org>, KP Singh
 <kpsingh@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
 linux-trace-kernel <linux-trace-kernel@...r.kernel.org>, Martin KaFai Lau
 <martin.lau@...ux.dev>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Matt Bobrowski
 <mattbobrowski@...gle.com>, Masami Hiramatsu <mhiramat@...nel.org>, Steven
 Rostedt <rostedt@...dmis.org>, Stanislav Fomichev <sdf@...ichev.me>, Song
 Liu <song@...nel.org>, syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
 Yonghong Song <yonghong.song@...ux.dev>
Subject: Re: [syzbot] [bpf?] [trace?] WARNING: locking bug in
 __lock_task_sighand

Alexei Starovoitov <alexei.starovoitov@...il.com> writes:

> On Tue, Dec 17, 2024 at 3:49 PM Alexei Starovoitov
> <alexei.starovoitov@...il.com> wrote:
>>
>> On Mon, Dec 2, 2024 at 4:42 AM Puranjay Mohan <puranjay@...nel.org> wrote:
>> >
>> > Alexei Starovoitov <alexei.starovoitov@...il.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.
>>
>> 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@kernel.org/

Thanks,
Puranjay

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

Download attachment "signature.asc" of type "application/pgp-signature" (256 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ