mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: Kees Cook <kees@kernel.org>, Steven Rostedt <rostedt@goodmis.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Petr Mladek <pmladek@suse.com>,
	linux-hardening@vger.kernel.org, llvm@lists.linux.dev,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] seq_buf: always inline seq_buf_terminate() and the helpers around it
Date: Mon, 16 Nov 2026 11:56:51 -0700	[thread overview]
Message-ID: <20261116185651.GB1036192@ax162> (raw)
In-Reply-To: <20261116022004.2373108-1-sashal@kernel.org>

On Sun, Nov 15, 2026 at 09:20:04PM -0500, Sasha Levin wrote:
> Commit 7b8cd26b6aab8 ("seq_buf: Mark a seq_buf overflowed when terminating
> it loses a byte") made __seq_buf_terminate() bigger, and clang no longer
> inlines seq_buf_terminate() into its two callers in
> kernel/trace/trace_events.c. Both pass bootup_event_seq, which is
> __initdata, so the out-of-line copy sits in .text with that address in it
> and modpost warns:
> 
>   WARNING: modpost: vmlinux: section mismatch in reference: seq_buf_terminate+0x12 (section: .text) -> bootup_event_seq (section: .init.data)
> 
> Both callers are __init, so nothing uses the buffer after it is freed.
> But the warning shows up in allmodconfig builds, and it is an error with
> CONFIG_SECTION_MISMATCH_WARN_ONLY=n.
> 
> Always inlining only seq_buf_terminate() and __seq_buf_terminate() moves
> the problem: clang then leaves seq_buf_set_overflow() out of line with the
> same address in it. So mark every inline helper that trace_events.c
> reaches with bootup_event_seq __always_inline: seq_buf_terminate(),
> __seq_buf_terminate(), seq_buf_set_overflow(), seq_buf_buffer_left(),
> seq_buf_has_overflowed() and seq_buf_used().
> 
> Fixes: 7b8cd26b6aab8 ("seq_buf: Mark a seq_buf overflowed when terminating it loses a byte")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202611110802.zPIiPSnJ-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202611120138.Fwm5Ljmj-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202611122226.vTBpAmtr-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202611122323.IvGv8FYK-lkp@intel.com/
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>

Tested-by: Nathan Chancellor <nathan@kernel.org> # build

-- 
Cheers,
Nathan

      reply	other threads:[~2026-11-16 18:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  2:20 Sasha Levin
2026-11-16 18:56 ` Nathan Chancellor [this message]

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=20261116185651.GB1036192@ax162 \
    --to=nathan@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sashal@kernel.org \
    /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

all inboxes | Powered by JetHome®