mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: haghdoost@uber.com, Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>, Leo Yan <leo.yan@linux.dev>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf symbols: Don't let a module's last symbol overlap the next module
Date: Tue, 29 Sep 2026 22:46:49 +0200	[thread overview]
Message-ID: <arwjudbuTiDKo7w2@x2> (raw)
In-Reply-To: <arv7nGmcDGjt7p7K@google.com>

On Tue, Sep 29, 2026 at 10:55:40AM -0700, Namhyung Kim wrote:
> On Mon, Sep 28, 2026 at 04:32:27PM -0700, Alireza Haghdoost via B4 Relay wrote:
> > From: Alireza Haghdoost <haghdoost@uber.com>
> > 
> > symbols__fixup_end() extends a zero-size symbol that is the last one in
> > the kernel or in a module to the end of the next page. On x86 the next
> > module can start in that page, so the stretched symbol overlaps it, and
> > a lookup can return the wrong symbol. For example:
> > 
> >   ffffffffc0c4aa50 t dca_sysfs_exit    [dca]
> >   ffffffffc0c4b000 t __nft_trace_packet [nf_tables]
> >   ffffffffc0c4b0b0 t nft_do_chain      [nf_tables]
> > 
> > dca_sysfs_exit gets end 0xffffffffc0c4c000, and samples in nft_do_chain
> > are reported as dca_sysfs_exit.
> > 
> > This patch clamps the end to the next symbol's start. The ARM case this
> > code was added for, where the next module is far away, is unchanged.
> > 
> > Add a "Kallsyms symbol ends" test case to the Symbols suite that covers
> > the kernel/module boundary, adjacent modules and a distant module.
> > 
> > Fixes: 8799ebce84d6 ("perf symbol: Update symbols__fixup_end()")
> > Fixes: bacefe0c7b77 ("perf tools: Fixup module symbol end address properly")
> > Signed-off-by: Alireza Haghdoost <haghdoost@uber.com>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo

      reply	other threads:[~2026-09-29 20:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28 23:32 Alireza Haghdoost via B4 Relay
2026-09-29 17:55 ` Namhyung Kim
2026-09-29 20:46   ` Arnaldo Carvalho de Melo [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=arwjudbuTiDKo7w2@x2 \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=haghdoost@uber.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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®