Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn --- arch/x86/kernel/cpu/bugs.c | 2 +- include/linux/compiler-gcc.h | 2 +- include/linux/module.h | 2 +- scripts/mod/modpost.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 500278f5308e..e8abe3f6c10e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = SPECTRE_V2_USER_NONE;
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE static bool spectre_v2_bad_module;
bool retpoline_module_ok(bool has_retpoline) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 2010493e1040..977ddf2774f9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -68,7 +68,7 @@ */ #define uninitialized_var(x) x = x
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE #define __noretpoline __attribute__((__indirect_branch__("keep"))) #endif
diff --git a/include/linux/module.h b/include/linux/module.h index fce6b4335e36..0c575f51fe57 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, static inline void module_bug_cleanup(struct module *mod) {} #endif /* CONFIG_GENERIC_BUG */
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE extern bool retpoline_module_ok(bool has_retpoline); #else static inline bool retpoline_module_ok(bool has_retpoline) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0d998c54564d..5a5b3780456f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2157,7 +2157,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) /* Cannot check for assembler */ static void add_retpoline(struct buffer *b) { - buf_printf(b, "\n#ifdef RETPOLINE\n"); + buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); buf_printf(b, "MODULE_INFO(retpoline, "Y");\n"); buf_printf(b, "#endif\n"); }
On 2018/12/11 0:37, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
arch/x86/kernel/cpu/bugs.c | 2 +- include/linux/compiler-gcc.h | 2 +- include/linux/module.h | 2 +- scripts/mod/modpost.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 500278f5308e..e8abe3f6c10e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = SPECTRE_V2_USER_NONE; -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE static bool spectre_v2_bad_module; bool retpoline_module_ok(bool has_retpoline) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 2010493e1040..977ddf2774f9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -68,7 +68,7 @@ */ #define uninitialized_var(x) x = x -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE #define __noretpoline __attribute__((__indirect_branch__("keep"))) #endif diff --git a/include/linux/module.h b/include/linux/module.h index fce6b4335e36..0c575f51fe57 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, static inline void module_bug_cleanup(struct module *mod) {} #endif /* CONFIG_GENERIC_BUG */ -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE extern bool retpoline_module_ok(bool has_retpoline); #else static inline bool retpoline_module_ok(bool has_retpoline) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0d998c54564d..5a5b3780456f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2157,7 +2157,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) /* Cannot check for assembler */ static void add_retpoline(struct buffer *b) {
- buf_printf(b, "\n#ifdef RETPOLINE\n");
- buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); buf_printf(b, "MODULE_INFO(retpoline, "Y");\n"); buf_printf(b, "#endif\n"); }
I have no idea why I have missed these chunks. Thank you for fixing.
Reviewed-by: Zhenzhong Duan zhenzhong.duan@oracle.com
On Tue, Dec 11, 2018 at 2:17 AM WANG Chao chao.wang@ucloud.cn wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
Reviewed-by: Masahiro Yamada yamada.masahiro@socionext.com
On 12/11/18 at 12:37P, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
ping ...
arch/x86/kernel/cpu/bugs.c | 2 +- include/linux/compiler-gcc.h | 2 +- include/linux/module.h | 2 +- scripts/mod/modpost.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 500278f5308e..e8abe3f6c10e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -213,7 +213,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = SPECTRE_V2_USER_NONE; -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE static bool spectre_v2_bad_module; bool retpoline_module_ok(bool has_retpoline) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 2010493e1040..977ddf2774f9 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -68,7 +68,7 @@ */ #define uninitialized_var(x) x = x -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE #define __noretpoline __attribute__((__indirect_branch__("keep"))) #endif diff --git a/include/linux/module.h b/include/linux/module.h index fce6b4335e36..0c575f51fe57 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -817,7 +817,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, static inline void module_bug_cleanup(struct module *mod) {} #endif /* CONFIG_GENERIC_BUG */ -#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE extern bool retpoline_module_ok(bool has_retpoline); #else static inline bool retpoline_module_ok(bool has_retpoline) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0d998c54564d..5a5b3780456f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2157,7 +2157,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) /* Cannot check for assembler */ static void add_retpoline(struct buffer *b) {
- buf_printf(b, "\n#ifdef RETPOLINE\n");
- buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); buf_printf(b, "MODULE_INFO(retpoline, "Y");\n"); buf_printf(b, "#endif\n");
}
2.19.2
On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
On 12/11/18 at 12:37P, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
ping ...
This one somehow slipped through the cracks... :-\
Ok, let's see: this could be relevant for the case when a module built with a compiler which doesn't support retpolines, gets loaded on a system which is built with retpolines.
Which is pretty seldom as the majority of setups out there should have a retpoline-enabled compiler. And should not allow loading external modules anyway, but that's a different story.
So, this close to the merge window, I'm inclined to delay this one after it and have it take the x86/urgent fixes path. Unless someone screams and says that patch breaks his system. I haven't seen any reports about it so far so...
Thx.
On 12/21/18 at 11:47P, Borislav Petkov wrote:
On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
On 12/11/18 at 12:37P, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
ping ...
This one somehow slipped through the cracks... :-\
Ok, let's see: this could be relevant for the case when a module built with a compiler which doesn't support retpolines, gets loaded on a system which is built with retpolines.
You're right.
Which is pretty seldom as the majority of setups out there should have a retpoline-enabled compiler. And should not allow loading external modules anyway, but that's a different story.
So, this close to the merge window, I'm inclined to delay this one after it and have it take the x86/urgent fixes path. Unless someone screams and says that patch breaks his system. I haven't seen any reports about it so far so...
OK. Thanks.
WANG Chao
From: Borislav Petkov
Sent: 21 December 2018 10:47 On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
On 12/11/18 at 12:37P, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
ping ...
This one somehow slipped through the cracks... :-\
Ok, let's see: this could be relevant for the case when a module built with a compiler which doesn't support retpolines, gets loaded on a system which is built with retpolines.
Isn't the real problem someone taking a kernel from (say) kernel.org that is compiled for retpolines and then trying to compile an additional module on a system that has an old compiler?
Which is pretty seldom as the majority of setups out there should have a retpoline-enabled compiler. And should not allow loading external modules anyway, but that's a different story.
Most of an external module is likely to be a big '.o' file that (I expect) has to be compiled without retpolines in order to be linkable into old kernels. (Either that or it doesn't matter at all because it is just a change to the generated code.)
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
On 12/21/18 at 11:47P, Borislav Petkov wrote:
On Fri, Dec 21, 2018 at 05:33:47PM +0800, WANG Chao wrote:
On 12/11/18 at 12:37P, WANG Chao wrote:
Since commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support"), RETPOLINE has been replaced by CONFIG_RETPOLINE.
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn
ping ...
This one somehow slipped through the cracks... :-\
Ok, let's see: this could be relevant for the case when a module built with a compiler which doesn't support retpolines, gets loaded on a system which is built with retpolines.
Which is pretty seldom as the majority of setups out there should have a retpoline-enabled compiler. And should not allow loading external modules anyway, but that's a different story.
So, this close to the merge window, I'm inclined to delay this one after it and have it take the x86/urgent fixes path. Unless someone screams and says that patch breaks his system. I haven't seen any reports about it so far so...
Hi, Boris.
Please pick up this one in x86/urgent.
Thanks Chao
Commit-ID: e4f358916d528d479c3c12bd2fd03f2d5a576380 Gitweb: https://git.kernel.org/tip/e4f358916d528d479c3c12bd2fd03f2d5a576380 Author: WANG Chao chao.wang@ucloud.cn AuthorDate: Tue, 11 Dec 2018 00:37:25 +0800 Committer: Borislav Petkov bp@suse.de CommitDate: Wed, 9 Jan 2019 10:35:56 +0100
x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE
Commit
4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support")
replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the remaining pieces.
[ bp: Massage commit message. ]
Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao chao.wang@ucloud.cn Signed-off-by: Borislav Petkov bp@suse.de Reviewed-by: Zhenzhong Duan zhenzhong.duan@oracle.com Reviewed-by: Masahiro Yamada yamada.masahiro@socionext.com Cc: "H. Peter Anvin" hpa@zytor.com Cc: Andi Kleen ak@linux.intel.com Cc: Andrew Morton akpm@linux-foundation.org Cc: Andy Lutomirski luto@kernel.org Cc: Arnd Bergmann arnd@arndb.de Cc: Daniel Borkmann daniel@iogearbox.net Cc: David Woodhouse dwmw@amazon.co.uk Cc: Geert Uytterhoeven geert@linux-m68k.org Cc: Jessica Yu jeyu@kernel.org Cc: Jiri Kosina jkosina@suse.cz Cc: Kees Cook keescook@chromium.org Cc: Konrad Rzeszutek Wilk konrad.wilk@oracle.com Cc: Luc Van Oostenryck luc.vanoostenryck@gmail.com Cc: Michal Marek michal.lkml@markovi.net Cc: Miguel Ojeda miguel.ojeda.sandonis@gmail.com Cc: Peter Zijlstra peterz@infradead.org Cc: Tim Chen tim.c.chen@linux.intel.com Cc: Vasily Gorbik gor@linux.ibm.com Cc: linux-kbuild@vger.kernel.org Cc: srinivas.eeda@oracle.com Cc: stable stable@vger.kernel.org Cc: x86-ml x86@kernel.org Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn --- arch/x86/kernel/cpu/bugs.c | 2 +- include/linux/compiler-gcc.h | 2 +- include/linux/module.h | 2 +- scripts/mod/modpost.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 8654b8b0c848..1de0f4170178 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -215,7 +215,7 @@ static enum spectre_v2_mitigation spectre_v2_enabled __ro_after_init = static enum spectre_v2_user_mitigation spectre_v2_user __ro_after_init = SPECTRE_V2_USER_NONE;
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE static bool spectre_v2_bad_module;
bool retpoline_module_ok(bool has_retpoline) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 5776da43da97..dd8268f5f5f0 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -68,7 +68,7 @@ */ #define uninitialized_var(x) x = x
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE #define __noretpoline __attribute__((__indirect_branch__("keep"))) #endif
diff --git a/include/linux/module.h b/include/linux/module.h index 9a21fe3509af..8fa38d3e7538 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -828,7 +828,7 @@ static inline void module_bug_finalize(const Elf_Ehdr *hdr, static inline void module_bug_cleanup(struct module *mod) {} #endif /* CONFIG_GENERIC_BUG */
-#ifdef RETPOLINE +#ifdef CONFIG_RETPOLINE extern bool retpoline_module_ok(bool has_retpoline); #else static inline bool retpoline_module_ok(bool has_retpoline) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 0de2fb236640..26bf886bd168 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -2185,7 +2185,7 @@ static void add_intree_flag(struct buffer *b, int is_intree) /* Cannot check for assembler */ static void add_retpoline(struct buffer *b) { - buf_printf(b, "\n#ifdef RETPOLINE\n"); + buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n"); buf_printf(b, "MODULE_INFO(retpoline, "Y");\n"); buf_printf(b, "#endif\n"); }
linux-stable-mirror@lists.linaro.org