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] [day] [month] [year] [list]
Message-ID: <Z4A9cMoSHVpAxF3-@x1>
Date: Thu, 9 Jan 2025 18:19:44 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Namhyung Kim <namhyung@...nel.org>,
	Kan Liang <kan.liang@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
	linux-perf-users@...r.kernel.org,
	Blake Jones <blakejones@...gle.com>,
	Luis Chamberlain <mcgrof@...nel.org>,
	Petr Pavlu <petr.pavlu@...e.com>,
	Sami Tolvanen <samitolvanen@...gle.com>,
	Daniel Gomez <da.gomez@...sung.com>, linux-modules@...r.kernel.org
Subject: Re: [PATCH] perf tools: Fixup end address of modules

On Wed, Dec 18, 2024 at 02:15:35PM -0800, Ian Rogers wrote:
> On Wed, Dec 18, 2024 at 2:04 PM Namhyung Kim <namhyung@...nel.org> wrote:
> >
> > In machine__create_module(), it reads /proc/modules to get a list of
> > modules in the system.  The file shows the start address (of text) and
> > the size of the module so it uses the info to reconstruct system memory
> > maps for symbol resolution.
> >
> > But module memory consists of multiple segments and they can be
> > scaterred.  Currently perf tools assume they are contiguous and see some
> 
> nit: s/scaterred/scattered/
> 
> > overlaps.  This can confuse the tool when it finds a map containing a
> > given address.
> >
> > As we mostly care about the function symbols in the text segment, it can
> > fixup the size or end address of modules when there's an overlap.  We
> > can use maps__fixup_end() which updates the end address using the start
> > address of the next map.
> >
> > Ideally it should be able to track other segments (like data/rodata),
> > but that would require some changes in /proc/modules IMHO.
> >
> > Reported-by: Blake Jones <blakejones@...gle.com>
> > Cc: Luis Chamberlain <mcgrof@...nel.org>
> > Cc: Petr Pavlu <petr.pavlu@...e.com>
> > Cc: Sami Tolvanen <samitolvanen@...gle.com>
> > Cc: Daniel Gomez <da.gomez@...sung.com>
> > Cc: linux-modules@...r.kernel.org
> > Signed-off-by: Namhyung Kim <namhyung@...nel.org>
> 
> Acked-by: Ian Rogers <irogers@...gle.com>

Thanks, applied to perf-tools-next,

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ