lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090722151123.GA4934@in.ibm.com>
Date:	Wed, 22 Jul 2009 20:41:23 +0530
From:	"K.Prasad" <prasad@...ux.vnet.ibm.com>
To:	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Thomas Gleixner <tglx@...utronix.de>,
	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <rostedt@...dmis.org>
Subject: Fix traceback seen when resuming after suspend-to-ram

Hi Ingo,
	Please accept a patch that fixes the warning message and traceback
seen upon a resume after suspend-to-ram.

The warning message is emitted because
spin_unlock_bh()<--load_debug_registers() is invoked with interrupts
disabled upon 'resume' unlike when invoked at boot-time, and was
reported on LKML here: http://lkml.org/lkml/2009/7/18/145.

This patch modifies load_debug_registers() to block all interrupts and not
just bottom-halves (bottom-halves were blocked in load_debug_registers()
prevent flush_thread_hw_breakpoint() from interfering when invoked from
SoftIRQ context).

Fix traceback seen when resuming after suspend-to-ram

This patch fixes a traceback when resuming after a suspend-to-ram operation.
The traceback warns about entering slowpatch due to a spin_unlock_bh() done
from interrupt context.

Signed-off-by: K.Prasad <prasad@...ux.vnet.ibm.com>
---
 kernel/hw_breakpoint.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Index: linux-2.6-tip/kernel/hw_breakpoint.c
===================================================================
--- linux-2.6-tip.orig/kernel/hw_breakpoint.c
+++ linux-2.6-tip/kernel/hw_breakpoint.c
@@ -80,17 +80,15 @@ void load_debug_registers(void)
 	unsigned long flags;
 	struct task_struct *tsk = current;
 
-	spin_lock_bh(&hw_breakpoint_lock);
-
 	/* Prevent IPIs for new kernel breakpoint updates */
-	local_irq_save(flags);
+	spin_lock_irqsave(&hw_breakpoint_lock, flags);
+
 	arch_update_kernel_hw_breakpoint(NULL);
-	local_irq_restore(flags);
 
 	if (test_tsk_thread_flag(tsk, TIF_DEBUG))
 		arch_install_thread_hw_breakpoint(tsk);
 
-	spin_unlock_bh(&hw_breakpoint_lock);
+	spin_unlock_irqrestore(&hw_breakpoint_lock, flags);
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ