From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53EE51E7C22; Wed, 15 Jan 2025 10:39:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937553; cv=none; b=P+HQzwQBpXTVAMKAuxK30J1rYznUAesHKDkp+sQRzC0iQJGgF/qYxtrM0K1leNCuBfRBgu4z9RTJV8USs8lCauuqIIvY2JF5Tivta3LbwpIMYOW8S/YY/mad7JB0jtmBYtpbEq+OS8hZqRYw6/OtUvxO2zsNTO3gaioqJyQ46kQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736937553; c=relaxed/simple; bh=DKeDSMDRLcKb3EsIb4UeOELYiUB4wAuvAFvDauJtTz4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=aSyQiNkuoPb4qwvKUUDVMReDaAWScA07Gz/rBNsSLwkJG1q8Jwu71mLeeed0XivuR5lsGM/Npbe98qI3V5uRy53P+D1NaPwl4RjcuixYyRjyUIHZ/4ut1xRBWVR+NMinlUwNnvII85oilU3KsOaVGqO17/PzqsEin6bjR5Ks+MY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bifLeUaz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bifLeUaz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8753AC4CEEC; Wed, 15 Jan 2025 10:39:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736937552; bh=DKeDSMDRLcKb3EsIb4UeOELYiUB4wAuvAFvDauJtTz4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bifLeUazxqHGYWzAyIzCKN9Lr0HVbiBojSXoDxzwBJwN4Bl5fVtwKhwyUjTtKADXd PQCOWVVozerQAR3XhODBOFu+aLNQaNYXBubSUdJZk3w1qXFwJJD76NdNi6ax5ZZNbl UXsqpsQmxErnKnWH/T1hWIsyy74VSES1ctNlbDsN8EeG38QiSGCO4Aw8rIVO27OPO4 pPVg044wZmM3nEYuVffIHmisbRbSY6k6LvftvWS0L8E2saaWALfG22aZNhjPbN8OCB VyitqjR2FFpmLP96MUmP2edJWV8reb8f1eB5GxRpPUL2bCSRTOhq27GmYsl3vGj05d NO35wOCfRSxAA== From: Puranjay Mohan To: Alexei Starovoitov Cc: syzbot , Andrii Nakryiko , Alexei Starovoitov , bpf , Daniel Borkmann , Eddy Z , Hao Luo , John Fastabend , Jiri Olsa , KP Singh , LKML , linux-trace-kernel , Martin KaFai Lau , Mathieu Desnoyers , Matt Bobrowski , Masami Hiramatsu , Steven Rostedt , Stanislav Fomichev , Song Liu , syzkaller-bugs , Yonghong Song Subject: Re: [syzbot] [bpf?] [trace?] WARNING: locking bug in __lock_task_sighand In-Reply-To: References: <67486b09.050a0220.253251.0084.GAE@google.com> Date: Wed, 15 Jan 2025 10:38:56 +0000 Message-ID: Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alexei Starovoitov writes: > On Tue, Dec 17, 2024 at 3:49=E2=80=AFPM Alexei Starovoitov > wrote: >> >> On Mon, Dec 2, 2024 at 4:42=E2=80=AFAM Puranjay Mohan wrote: >> > >> > Alexei Starovoitov 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() =3D=3D 0 && !irqs_disabled()) >> > >> > and we need if ((preempt_count() !=3D 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.3= 8487-1-puranjay@kernel.org/ Thanks, Puranjay #syz test: https://github.com/puranjaymohan/bpf.git bpf_preemt_fix --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYKADIWIQQ3wHGvVs/5bdl78BKwwPkjG3B2nQUCZ4eQQRQccHVyYW5qYXlA a2VybmVsLm9yZwAKCRCwwPkjG3B2naW6AQCrWnOZ/OtsclWT1hQw6i7s0mEBacwN J5+VPyQbt3jgJAEAyWEMjhLAOHW65D0ok+4Soqgz/YcEp917e4J3TCijFQY= =dEwy -----END PGP SIGNATURE----- --=-=-=--