Patch "hexagon: Fix unbalanced spinlock in die()" 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

    hexagon: Fix unbalanced spinlock in die()

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:
     hexagon-fix-unbalanced-spinlock-in-die.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 7cb4df45b4f59dcb1036589698b52ec78e054184
Author: Lin Yujun <linyujun809@xxxxxxxxxx>
Date:   Mon May 22 02:56:08 2023 +0000

    hexagon: Fix unbalanced spinlock in die()
    
    [ Upstream commit 03410e87563a122075c3721acc7d5510e41d8332 ]
    
    die executes holding the spinlock of &die.lock and unlock
    it after printing the oops message.
    However in the code if the notify_die() returns NOTIFY_STOP
    , die() exit with returning 1 but never unlocked the spinlock.
    
    Fix this by adding spin_unlock_irq(&die.lock) before returning.
    
    Fixes: cf9750bae262 ("Hexagon: Provide basic debugging and system trap support.")
    Signed-off-by: Lin Yujun <linyujun809@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230522025608.2515558-1-linyujun809@xxxxxxxxxx
    Signed-off-by: Brian Cain <bcain@xxxxxxxxxxx>
    Signed-off-by: Brian Cain <brian.cain@xxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
index 75e062722d285..040a958de1dfc 100644
--- a/arch/hexagon/kernel/traps.c
+++ b/arch/hexagon/kernel/traps.c
@@ -195,8 +195,10 @@ int die(const char *str, struct pt_regs *regs, long err)
 	printk(KERN_EMERG "Oops: %s[#%d]:\n", str, ++die.counter);
 
 	if (notify_die(DIE_OOPS, str, regs, err, pt_cause(regs), SIGSEGV) ==
-	    NOTIFY_STOP)
+	    NOTIFY_STOP) {
+		spin_unlock_irq(&die.lock);
 		return 1;
+	}
 
 	print_modules();
 	show_regs(regs);




[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