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] [day] [month] [year] [list]
Message-ID: <mb61p8qsymf3i.fsf@kernel.org>
Date: Mon, 02 Dec 2024 12:41:53 +0000
From: Puranjay Mohan <puranjay@...nel.org>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>, syzbot
 <syzbot+97da3d7e0112d59971de@...kaller.appspotmail.com>
Cc: 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:

> 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

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