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 891551FECB0; Mon, 2 Dec 2024 12:42:20 +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=1733143340; cv=none; b=BexYvZikSBYiDD6bzFk9oJINv+gH3BoqvN+QCCZ9Q71xEXbSb3P/CpfBMm3z09+JGUXJMKYDbNWutvjV72YlRXWMKUtOznSOLgRaEPFzLK0+pUTNDMRLtOi3YgHLbBwlaDMNJuvT81THWyhzCRboApwgSKzK3YlaGYsuEjPVuIE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733143340; c=relaxed/simple; bh=ZUxsmMS3Mj50Owl+CtW2LaA41VDB9pzBJe4flh17kE4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=UzTta4Qw5ieM9kW4jWJR0jBITlbXH6WDaARM1ZrHwm+TMu7fjd8Vzl3xs6lJU/ZyM6f0yEyVzn2qyNMjm5bypxsdJDV+ZW7bh21rbqpu5TDkh4Fk1Ixet4gl4/zleUdTpMyj/FvYx21BuX4jtB0ori1o9K1wk6DP9oioz3XKQ+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VKcValhA; 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="VKcValhA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0B8FC4CED1; Mon, 2 Dec 2024 12:42:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733143340; bh=ZUxsmMS3Mj50Owl+CtW2LaA41VDB9pzBJe4flh17kE4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VKcValhAP4NDcMq/BocoSWIXUDyL28n9ptnqgRUar2qUTZIMdwx8ByaITVypHFTPT bUb3bVM91nBMHksI/U/neBGSK0sySs/xJHRLw+H6UyoLCBl1Gr6OC6Qv1KEy12zQxZ hSEsvhGp/SFzbvnr8Wt8gFquW4j098xst6fdQhmvF6eVR5w1rmbeHzP9yPik4lYU7l FP3Om2BBHPdY5e+TemqzKyQR5fqVp+kEr8ADFrDVgcwVwBCyCirSW/dCa/8NTxPWJX 2k3m9Sa+NsFeJ12IvtIVquysDp5b5RCZLmv7hR83Fn9ZwXtPEeAzDP91AXDPoPrpAG O18xqHaFJ3eMA== From: Puranjay Mohan To: Alexei Starovoitov , syzbot Cc: 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: Mon, 02 Dec 2024 12:41:53 +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 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() == 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIoEARYKADIWIQQ3wHGvVs/5bdl78BKwwPkjG3B2nQUCZ02rEhQccHVyYW5qYXlA a2VybmVsLm9yZwAKCRCwwPkjG3B2neeVAP9oIrj3EmYDgSEJCJ4dIGcv2o4GKh1j WMnk4NhjuJMnUQD9FeG8rr2tbb38XZ3h6tpRcsFUfmbD1uTcqCQ+kCFkWwU= =8s87 -----END PGP SIGNATURE----- --=-=-=--