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: <20250919135557.280852-1-dmantipov@yandex.ru>
Date: Fri, 19 Sep 2025 16:55:57 +0300
From: Dmitry Antipov <dmantipov@...dex.ru>
To: Josh Poimboeuf <jpoimboe@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>
Cc: linux-kernel@...r.kernel.org,
	Dmitry Antipov <dmantipov@...dex.ru>
Subject: [PATCH RESEND] objtool: speedup subsequent calls to dead_end_function()

Running over KASAN-enabled vmlinux.o, some functions comes from the
sanitizer runtime may be processed by 'dead_end_function()' a lot of
times, so it's reasonable to record the result in 'struct symbol' of
the relevant function. Briefly testing over huge 'make allyesconfig'
vmlinux.o, this may speedup objtool by nearly 10%.

Signed-off-by: Dmitry Antipov <dmantipov@...dex.ru>
---
 tools/objtool/check.c               | 5 ++++-
 tools/objtool/include/objtool/elf.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index d14f20ef1db1..d4c0ef419b95 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -322,7 +322,10 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func,
 
 static bool dead_end_function(struct objtool_file *file, struct symbol *func)
 {
-	return __dead_end_function(file, func, 0);
+	if (func->functype == UNKNOWN)
+		func->functype = (__dead_end_function(file, func, 0)
+				  ? NORETURN : REGULAR);
+	return func->functype == NORETURN;
 }
 
 static void init_cfi_state(struct cfi_state *cfi)
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h
index 0a2fa3ac0079..2c491eb07741 100644
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -70,6 +70,7 @@ struct symbol {
 	u8 local_label       : 1;
 	u8 frame_pointer     : 1;
 	u8 ignore	     : 1;
+	enum { UNKNOWN, REGULAR, NORETURN } functype : 2;
 	struct list_head pv_target;
 	struct reloc *relocs;
 	struct section *group_sec;
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ