* Re: [PATCH] module: fix clang CFI with MODULE_UNLOAD=n
2021-09-27 12:15 [PATCH] module: fix clang CFI with MODULE_UNLOAD=n Arnd Bergmann
@ 2021-09-27 13:34 ` Miroslav Benes
2021-09-27 15:27 ` Sami Tolvanen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Miroslav Benes @ 2021-09-27 13:34 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Luis Chamberlain, Jessica Yu, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, Greg Kroah-Hartman, Kees Cook, Sergey Shtylyov,
Sami Tolvanen, Stephen Boyd, linux-kernel, llvm
On Mon, 27 Sep 2021, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_MODULE_UNLOAD is disabled, the module->exit member
> is not defined, causing a build failure:
>
> kernel/module.c:4493:8: error: no member named 'exit' in 'struct module'
> mod->exit = *exit;
>
> add an #ifdef block around this.
>
> Fixes: cf68fffb66d6 ("add support for Clang CFI")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
M
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] module: fix clang CFI with MODULE_UNLOAD=n
2021-09-27 12:15 [PATCH] module: fix clang CFI with MODULE_UNLOAD=n Arnd Bergmann
2021-09-27 13:34 ` Miroslav Benes
@ 2021-09-27 15:27 ` Sami Tolvanen
2021-09-27 16:21 ` Kees Cook
2021-09-28 11:01 ` Jessica Yu
3 siblings, 0 replies; 5+ messages in thread
From: Sami Tolvanen @ 2021-09-27 15:27 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Luis Chamberlain, Jessica Yu, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, Miroslav Benes, Greg Kroah-Hartman, Kees Cook,
Sergey Shtylyov, Stephen Boyd, LKML, llvm
Hi Arnd,
On Mon, Sep 27, 2021 at 5:15 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_MODULE_UNLOAD is disabled, the module->exit member
> is not defined, causing a build failure:
>
> kernel/module.c:4493:8: error: no member named 'exit' in 'struct module'
> mod->exit = *exit;
>
> add an #ifdef block around this.
>
> Fixes: cf68fffb66d6 ("add support for Clang CFI")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> kernel/module.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/module.c b/kernel/module.c
> index 40ec9a030eec..5c26a76e800b 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -4489,8 +4489,10 @@ static void cfi_init(struct module *mod)
> /* Fix init/exit functions to point to the CFI jump table */
> if (init)
> mod->init = *init;
> +#ifdef CONFIG_MODULE_UNLOAD
> if (exit)
> mod->exit = *exit;
> +#endif
>
> cfi_module_add(mod, module_addr_min);
> #endif
Thanks for the fix!
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Sami
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] module: fix clang CFI with MODULE_UNLOAD=n
2021-09-27 12:15 [PATCH] module: fix clang CFI with MODULE_UNLOAD=n Arnd Bergmann
2021-09-27 13:34 ` Miroslav Benes
2021-09-27 15:27 ` Sami Tolvanen
@ 2021-09-27 16:21 ` Kees Cook
2021-09-28 11:01 ` Jessica Yu
3 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2021-09-27 16:21 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Luis Chamberlain, Jessica Yu, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, Miroslav Benes, Greg Kroah-Hartman,
Sergey Shtylyov, Sami Tolvanen, Stephen Boyd, linux-kernel, llvm
On Mon, Sep 27, 2021 at 02:15:10PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> When CONFIG_MODULE_UNLOAD is disabled, the module->exit member
> is not defined, causing a build failure:
>
> kernel/module.c:4493:8: error: no member named 'exit' in 'struct module'
> mod->exit = *exit;
>
> add an #ifdef block around this.
>
> Fixes: cf68fffb66d6 ("add support for Clang CFI")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Nice catch; thanks! (Not a lot of config build that way it seems...)
Acked-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] module: fix clang CFI with MODULE_UNLOAD=n
2021-09-27 12:15 [PATCH] module: fix clang CFI with MODULE_UNLOAD=n Arnd Bergmann
` (2 preceding siblings ...)
2021-09-27 16:21 ` Kees Cook
@ 2021-09-28 11:01 ` Jessica Yu
3 siblings, 0 replies; 5+ messages in thread
From: Jessica Yu @ 2021-09-28 11:01 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Luis Chamberlain, Arnd Bergmann, Nathan Chancellor,
Nick Desaulniers, Miroslav Benes, Greg Kroah-Hartman, Kees Cook,
Sergey Shtylyov, Sami Tolvanen, Stephen Boyd, linux-kernel, llvm
+++ Arnd Bergmann [27/09/21 14:15 +0200]:
>From: Arnd Bergmann <arnd@arndb.de>
>
>When CONFIG_MODULE_UNLOAD is disabled, the module->exit member
>is not defined, causing a build failure:
>
>kernel/module.c:4493:8: error: no member named 'exit' in 'struct module'
> mod->exit = *exit;
>
>add an #ifdef block around this.
>
>Fixes: cf68fffb66d6 ("add support for Clang CFI")
>Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks everyone!
Jessica
^ permalink raw reply [flat|nested] 5+ messages in thread