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: <CABCJKucOoov6aWzP3bcTwewNHFRbQn=nFvtkcZQ34hSm+K8+iw@mail.gmail.com>
Date:   Mon, 27 Sep 2021 08:27:16 -0700
From:   Sami Tolvanen <samitolvanen@...gle.com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Luis Chamberlain <mcgrof@...nel.org>, Jessica Yu <jeyu@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Miroslav Benes <mbenes@...e.cz>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kees Cook <keescook@...omium.org>,
        Sergey Shtylyov <s.shtylyov@...russia.ru>,
        Stephen Boyd <swboyd@...omium.org>,
        LKML <linux-kernel@...r.kernel.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH] module: fix clang CFI with MODULE_UNLOAD=n

Hi Arnd,

On Mon, Sep 27, 2021 at 5:15 AM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.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@...db.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@...gle.com>

Sami

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ