Skip to content

Commit 4d60551

Browse files
bpf: Send signals asynchronously if !preemptible
JIRA: https://issues.redhat.com/browse/RHEL-85486 JIRA: https://issues.redhat.com/browse/RHEL-81243 CVE: CVE-2025-21728 Conflicts: Context change due to missing commit 6280cf7 ("bpf: Implement bpf_send_signal_task() kfunc"). commit 87c5441 Author: Puranjay Mohan <[email protected]> Date: Wed Jan 15 10:36:47 2025 +0000 bpf: Send signals asynchronously if !preemptible 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: [email protected] Closes: https://lore.kernel.org/all/[email protected]/ Fixes: 1bc7896 ("bpf: Fix deadlock with rq_lock in bpf_send_signal()") Signed-off-by: Puranjay Mohan <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]> Signed-off-by: Jerome Marchand <[email protected]>
1 parent 0f718a5 commit 4d60551

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/bpf_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static int bpf_send_signal_common(u32 sig, enum pid_type type)
832832
if (unlikely(is_global_init(current)))
833833
return -EPERM;
834834

835-
if (irqs_disabled()) {
835+
if (!preemptible()) {
836836
/* Do an early check on signal validity. Otherwise,
837837
* the error is lost in deferred irq_work.
838838
*/

0 commit comments

Comments
 (0)