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>] [day] [month] [year] [list]
Message-Id: <20190401000327.26742-1-mcroce@redhat.com>
Date:   Mon,  1 Apr 2019 02:03:27 +0200
From:   Matteo Croce <mcroce@...hat.com>
To:     x86@...nel.org
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>
Subject: [PATCH] x86/traps: print faulty addresses on stack overflow

Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"),
when a stack overflow happens "____ptrval____" is printed instead of the
real addresses:

    BUG: stack guard page was hit at (____ptrval____) (stack is (____ptrval____)..(____ptrval____))

Even if leaking kernel layout information is usually a bad thing, probably
the system needs to be rebooted anyway past this point, so force the
address print as the obfuscation makes the error message useless.

Signed-off-by: Matteo Croce <mcroce@...hat.com>
---
 arch/x86/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index d26f9e9c3d83..0d3695334dfd 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -301,7 +301,7 @@ __visible void __noreturn handle_stack_overflow(const char *message,
 						struct pt_regs *regs,
 						unsigned long fault_address)
 {
-	printk(KERN_EMERG "BUG: stack guard page was hit at %p (stack is %p..%p)\n",
+	printk(KERN_EMERG "BUG: stack guard page was hit at %px (stack is %px..%px)\n",
 		 (void *)fault_address, current->stack,
 		 (char *)current->stack + THREAD_SIZE - 1);
 	die(message, regs, 0);
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ