From: Petr Pavlu <petr.pavlu@suse.com>
To: sashiko-reviews@lists.linux.dev
Cc: bpf@vger.kernel.org, linux-modules@vger.kernel.org
Subject: Re: [PATCH v2] module: Add stubs.c for CONFIG_MODULES=n module_put_and_kthread_exit()
Date: Fri, 2 Oct 2026 13:58:48 +0200 [thread overview]
Message-ID: <c166a29c-14f4-44ee-81ac-d79c82175fc8@suse.com> (raw)
In-Reply-To: <20261002091451.D4FBC1F00893@smtp.kernel.org>
On 10/2/26 11:14 AM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] bpf: resolve_btfids build failure with CONFIG_MODULES=n and LTO/GC
> --
>
> commit caaeb9d0651743944c690c066494bb16509c01e9
> Author: Petr Pavlu <petr.pavlu@suse.com>
>
> module: Add stubs.c for CONFIG_MODULES=n module_put_and_kthread_exit()
>
> This commit introduces kernel/module/stubs.c to hold stub functions when
> CONFIG_MODULES is disabled. It moves the stub implementation for
> __module_put_and_kthread_exit() to this new file and removes the
> corresponding #ifdef from the BPF verifier's noreturn list.
>
>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
>> index 72a3f5998dd27..be70f10e49682 100644
>> --- a/kernel/bpf/verifier.c
>> +++ b/kernel/bpf/verifier.c
>> @@ -20417,9 +20417,7 @@ BTF_ID(func, __ia32_sys_exit_group)
>> BTF_ID(func, __kunit_abort)
>> BTF_ID(func, kunit_try_catch_throw)
>> #endif
>> -#ifdef CONFIG_MODULES
>> BTF_ID(func, __module_put_and_kthread_exit)
>
> [Severity: Low]
> If CONFIG_MODULES=n and dead-code elimination (like CONFIG_LTO_CLANG or
> CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) is enabled, will this cause
> resolve_btfids to fail?
>
> Because the #ifdef is removed, this unconditionally requires the function to
> be present in the BTF. If there are no callers in the kernel, the linker
> might discard the stub function, causing a missing BTF ID and a fatal build
> error under CONFIG_WERROR.
This is a valid issue. I think a simple solution would be to mark
__module_put_and_kthread_exit() as __retain.
-- Petr
next prev parent reply other threads:[~2026-10-02 11:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-02 8:40 [PATCH v2] module: Add stubs.c for CONFIG_MODULES=n module_put_and_kthread_exit() Petr Pavlu
2026-10-02 9:14 ` sashiko-bot
2026-10-02 11:58 ` Petr Pavlu [this message]
2026-10-04 12:49 ` Aaron Tomlin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c166a29c-14f4-44ee-81ac-d79c82175fc8@suse.com \
--to=petr.pavlu@suse.com \
--cc=bpf@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox