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]
Message-Id: <20170217104757.28588-7-jslaby@suse.cz>
Date:   Fri, 17 Feb 2017 11:47:54 +0100
From:   Jiri Slaby <jslaby@...e.cz>
To:     mingo@...hat.com
Cc:     tglx@...utronix.de, hpa@...or.com, x86@...nel.org,
        jpoimboe@...hat.com, linux-kernel@...r.kernel.org,
        Jiri Slaby <jslaby@...e.cz>
Subject: [PATCH 07/10] linkage: introduce ALIASes

Sometimes we see in the assembly:
===
	.align 4
	_key_expansion_128:
	ENTRY_LOCAL(_key_expansion_256a)
	...
	ENDPROC(_key_expansion_256a)
	ENDPROC(_key_expansion_128)
=== or ===
	ENTRY(__memcpy)
	ENTRY(memcpy)
	...
	ENDPROC(memcpy)
	ENDPROC(__memcpy)
===

In the former, the outer "function" (alias) _key_expansion_128 is marked
as function by ENDPROC, but there is no corresponding ENTRY for that. In
the latter, there are nested ENTRYs and ENDPROCs. And since we want them
to emit some debuginfo, the nesting makes it impossible.

Hence introduce ENTRY_ALIAS/END_ALIAS to differentiate this case --
ENTRY will emit debuginfo, ENTRY_ALIAS will not.

Signed-off-by: Jiri Slaby <jslaby@...e.cz>
---
 include/linux/linkage.h | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index ca5d5c01009b..fe5bbdac719b 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -78,17 +78,35 @@
 #define ALIGN __ALIGN
 #define ALIGN_STR __ALIGN_STR
 
-#ifndef ENTRY_LOCAL
-#define ENTRY_LOCAL(name) \
+#ifndef ENTRY_LOCAL_ALIAS
+#define ENTRY_LOCAL_ALIAS(name) \
 	ALIGN ASM_NL \
 	name:
 #endif
 
+#ifndef ENTRY_ALIAS
+#define ENTRY_ALIAS(name) \
+	.globl name ASM_NL \
+	ENTRY_LOCAL_ALIAS(name)
+#endif
+
+#ifndef ENTRY_LOCAL
+#define ENTRY_LOCAL(name) \
+	ENTRY_LOCAL_ALIAS(name)
+#endif
+
 #ifndef ENTRY
 #define ENTRY(name) \
 	.globl name ASM_NL \
 	ENTRY_LOCAL(name)
 #endif
+
+#ifndef END_ALIAS
+#define END_ALIAS(name) \
+	.type name, @function ASM_NL \
+	END(name)
+#endif
+
 #endif /* LINKER_SCRIPT */
 
 #ifndef WEAK
@@ -108,8 +126,7 @@
  */
 #ifndef ENDPROC
 #define ENDPROC(name) \
-	.type name, @function ASM_NL \
-	END(name)
+	END_ALIAS(name)
 #endif
 
 #endif
-- 
2.11.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ