Patch "bpf: Send signals asynchronously if !preemptible" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    bpf: Send signals asynchronously if !preemptible

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bpf-send-signals-asynchronously-if-preemptible.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b19ac38b7d19dec9016146515f4b9a0c8f047554
Author: Puranjay Mohan <puranjay@xxxxxxxxxx>
Date:   Wed Jan 15 10:36:47 2025 +0000

    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@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://lore.kernel.org/all/67486b09.050a0220.253251.0084.GAE@xxxxxxxxxx/
    Fixes: 1bc7896e9ef4 ("bpf: Fix deadlock with rq_lock in bpf_send_signal()")
    Signed-off-by: Puranjay Mohan <puranjay@xxxxxxxxxx>
    Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20250115103647.38487-1-puranjay@xxxxxxxxxx
    Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index b5cf605fb0e60..449efaaa387a6 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -833,7 +833,7 @@ static int bpf_send_signal_common(u32 sig, enum pid_type type)
 	if (unlikely(is_global_init(current)))
 		return -EPERM;
 
-	if (irqs_disabled()) {
+	if (!preemptible()) {
 		/* Do an early check on signal validity. Otherwise,
 		 * the error is lost in deferred irq_work.
 		 */




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux