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: <20241217083059.1124426-1-arnd@kernel.org>
Date: Tue, 17 Dec 2024 09:30:41 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Dave Hansen <dave.hansen@...ux.intel.com>,
	Andy Lutomirski <luto@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Borislav Petkov <bp@...en8.de>,
	x86@...nel.org
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
	Arnd Bergmann <arnd@...db.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jason Gunthorpe <jgg@...pe.ca>,
	Suren Baghdasaryan <surenb@...gle.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] x86/mm: avoid false-positive objtool warning in page_fault_oops()

From: Arnd Bergmann <arnd@...db.de>

When printing the oops for a VMAP_STACK overflow, the final call
frompage_fault_oops() does not return to the original stack, which
confuses gcc, and the unreachable() annotation leads to the end
of the function just continuing on in the next one:

arch/x86/mm/fault.o: warning: objtool: page_fault_oops() falls through to next function kernelmode_fixup_or_oops.constprop.0()

To work around the warning, add an explicit endless loop here that
objtool can detect.

Fixes: 6271cfdfc0e4 ("x86/mm: Improve stack-overflow #PF handling")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
I'm not sure about this one, maybe there is a way for objtool to
detect this and not warn?
---
 arch/x86/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index e6c469b323cc..0ef6e3cc54d2 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -678,7 +678,7 @@ page_fault_oops(struct pt_regs *regs, unsigned long error_code,
 			      ASM_CALL_ARG3,
 			      , [arg1] "r" (regs), [arg2] "r" (address), [arg3] "r" (&info));
 
-		unreachable();
+		do { } while (1); /* unreachable */
 	}
 #endif
 
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ