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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Dec 2016 20:52:32 +0100
From:   Jiri Slaby <jslaby@...e.cz>
To:     stable@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        HATAYAMA Daisuke <d.hatayama@...fujitsu.com>,
        Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
        Jiri Kosina <jkosina@...e.cz>, Baoquan He <bhe@...hat.com>,
        Prarit Bhargava <prarit@...hat.com>,
        Xie XiuQi <xiexiuqi@...wei.com>,
        Seth Jennings <sjenning@...hat.com>,
        "K. Y. Srinivasan" <kys@...rosoft.com>, Jan Kara <jack@...e.cz>,
        Petr Mladek <pmladek@...e.cz>,
        Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 3.12 06/38] kernel/panic.c: turn off locks debug before releasing console lock

From: Vitaly Kuznetsov <vkuznets@...hat.com>

3.12-stable review patch.  If anyone has any objections, please let me know.

===============

commit 7625b3a0007decf2b135cb47ca67abc78a7b1bc1 upstream.

Commit 08d78658f393 ("panic: release stale console lock to always get the
logbuf printed out") introduced an unwanted bad unlock balance report when
panic() is called directly and not from OOPS (e.g.  from out_of_memory()).
The difference is that in case of OOPS we disable locks debug in
oops_enter() and on direct panic call nobody does that.

Fixes: 08d78658f393 ("panic: release stale console lock to always get the logbuf printed out")
Reported-by: kernel test robot <ying.huang@...ux.intel.com>
Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: HATAYAMA Daisuke <d.hatayama@...fujitsu.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Cc: Jiri Kosina <jkosina@...e.cz>
Cc: Baoquan He <bhe@...hat.com>
Cc: Prarit Bhargava <prarit@...hat.com>
Cc: Xie XiuQi <xiexiuqi@...wei.com>
Cc: Seth Jennings <sjenning@...hat.com>
Cc: "K. Y. Srinivasan" <kys@...rosoft.com>
Cc: Jan Kara <jack@...e.cz>
Cc: Petr Mladek <pmladek@...e.cz>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@...fujitsu.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
 kernel/panic.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index de5924c75b1b..639255d5e5e1 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -138,8 +138,11 @@ void panic(const char *fmt, ...)
 	 * We may have ended up stopping the CPU holding the lock (in
 	 * smp_send_stop()) while still having some valuable data in the console
 	 * buffer.  Try to acquire the lock then release it regardless of the
-	 * result.  The release will also print the buffers out.
+	 * result.  The release will also print the buffers out.  Locks debug
+	 * should be disabled to avoid reporting bad unlock balance when
+	 * panic() is not being callled from OOPS.
 	 */
+	debug_locks_off();
 	console_flush_on_panic();
 
 	if (!panic_blink)
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ