lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Mar 2019 16:44:12 +0100
From:   Arnd Bergmann <>
To:, Catalin Marinas <>,
        Will Deacon <>,
        Mark Rutland <>,
        "Eric W. Biederman" <>,
        Marc Zyngier <>,
        Anshuman Khandual <>,
        Andrey Konovalov <>
Cc:     Qiao Zhou <>, Arnd Bergmann <>,,
Subject: [BACKPORT 4.4.y 21/25] arm64: traps: disable irq in die()

From: Qiao Zhou <>

In current die(), the irq is disabled for __die() handle, not
including the possible panic() handling. Since the log in __die()
can take several hundreds ms, new irq might come and interrupt
current die().

If the process calling die() holds some critical resource, and some
other process scheduled later also needs it, then it would deadlock.
The first panic will not be executed.

So here disable irq for the whole flow of die().

Signed-off-by: Qiao Zhou <>
Signed-off-by: Will Deacon <>
(cherry picked from commit 6f44a0bacb79a03972c83759711832b382b1b8ac)
Signed-off-by: Arnd Bergmann <>
 arch/arm64/kernel/traps.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 5d270ca76aec..6b4579e07aa2 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -239,10 +239,12 @@ void die(const char *str, struct pt_regs *regs, int err)
 	struct thread_info *thread = current_thread_info();
 	int ret;
+	unsigned long flags;
+	raw_spin_lock_irqsave(&die_lock, flags);
-	raw_spin_lock_irq(&die_lock);
 	ret = __die(str, err, thread, regs);
@@ -252,13 +254,15 @@ void die(const char *str, struct pt_regs *regs, int err)
-	raw_spin_unlock_irq(&die_lock);
 	if (in_interrupt())
 		panic("Fatal exception in interrupt");
 	if (panic_on_oops)
 		panic("Fatal exception");
+	raw_spin_unlock_irqrestore(&die_lock, flags);
 	if (ret != NOTIFY_STOP)

Powered by blists - more mailing lists