]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Send signals asynchronously if !preemptible
authorPuranjay Mohan <puranjay@kernel.org>
Wed, 15 Jan 2025 10:36:47 +0000 (10:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:02 +0000 (12:50 +0100)
commite306eaaa3d78b462db5f5b11e0171f9d2b6ca3f4
treebd0be81e842efa479295e2e4b0699457187eb2ac
parentd6becd34dc6587441b3c72088c60cb25552569cb
bpf: Send signals asynchronously if !preemptible

[ Upstream commit 87c544108b612512b254c8f79aa5c0a8546e2cc4 ]

BPF programs can execute in all kinds of contexts and when a program
running in a non-preemptible context uses the bpf_send_signal() kfunc,
it will cause issues because this kfunc can sleep.
Change `irqs_disabled()` to `!preemptible()`.

Reported-by: syzbot+97da3d7e0112d59971de@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/67486b09.050a0220.253251.0084.GAE@google.com/
Fixes: 1bc7896e9ef4 ("bpf: Fix deadlock with rq_lock in bpf_send_signal()")
Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250115103647.38487-1-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/bpf_trace.c