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:   Sat, 10 Nov 2018 08:09:17 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Ard Biesheuvel <ard.biesheuvel@...aro.org>
Cc:     Josh Poimboeuf <jpoimboe@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Jason Baron <jbaron@...mai.com>, Jiri Kosina <jkosina@...e.cz>,
        David Laight <David.Laight@...lab.com>,
        Borislav Petkov <bp@...en8.de>
Subject: Re: [RFC PATCH 1/3] static_call: Add static call infrastructure

On Sat, 10 Nov 2018 12:58:08 +0100
Ard Biesheuvel <ard.biesheuvel@...aro.org> wrote:


> > The complaint is on:
> >
> >         DEFINE_STATIC_CALL(__tp_func_##name, __tracepoint_iter_##name);
> >
> > And the previous definition is on:
> >
> >         DECLARE_STATIC_CALL(__tp_func_##name, __tracepoint_iter_##name); \
> >  
> 
> Does the DECLARE really need the __ADDRESSABLE? Its purpose is to
> ensure that symbols with static linkage are not optimized away, but
> since the reference is from a header file, the symbol should have
> external linkage anyway.

I applied the following change and it compiled fine:

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 90b580b95303..5f8a0f0e77be 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -108,8 +108,6 @@ extern void arch_static_call_poison_tramp(unsigned long insn);
 #define DECLARE_STATIC_CALL(key, func)					\
 	extern struct static_call_key key;				\
 	extern typeof(func) STATIC_CALL_TRAMP(key);			\
-	/* Preserve the ELF symbol so objtool can access it: */		\
-	__ADDRESSABLE(key)
 
 #define DEFINE_STATIC_CALL(key, _func)					\
 	DECLARE_STATIC_CALL(key, _func);				\
@@ -117,7 +115,9 @@ extern void arch_static_call_poison_tramp(unsigned long insn);
 		.func = _func,						\
 		.site_mods = LIST_HEAD_INIT(key.site_mods),		\
 	};								\
-	ARCH_STATIC_CALL_TEMPORARY_TRAMP(key)
+	ARCH_STATIC_CALL_TEMPORARY_TRAMP(key);				\
+	/* Preserve the ELF symbol so objtool can access it: */		\
+	__ADDRESSABLE(key)
 
 #define static_call(key, args...) STATIC_CALL_TRAMP(key)(args)

Thanks!
 
-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ