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: <aLhjnex4_SXpV_8N@x1>
Date: Wed, 3 Sep 2025 12:49:49 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Zecheng Li <zecheng@...gle.com>, Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Mark Rutland <mark.rutland@....com>,
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
	Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	"Liang, Kan" <kan.liang@...ux.intel.com>,
	Masami Hiramatsu <mhiramat@...nel.org>,
	Xu Liu <xliuprof@...gle.com>, linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 01/10] perf dwarf-aux: Use signed variable types in
 match_var_offset

On Wed, Aug 27, 2025 at 11:52:02PM -0700, Namhyung Kim wrote:
> On Mon, Aug 25, 2025 at 07:54:03PM +0000, Zecheng Li wrote:
> > match_var_offset compares address offsets to determine if an access
> > falls within a variable's bounds. The offsets involved for those
> > relative to base registers from DW_OP_breg can be negative.

> > The current implementation uses unsigned types (u64) for these offsets,
> > which rejects almost all negative values.
 
> Right, I thought it cannot get negative offsets except for stack access
> (e.g. fbreg).  But it turns out that container_of() trick can generate
> them with optimizing compilers.
 
> > Change the signature of match_var_offset to use signed types (s64). This
> > ensures correct behavior when addr_offset or addr_type are negative.

> > Signed-off-by: Zecheng Li <zecheng@...gle.com>
 
> I've confirmed it produced slightly better results on my test sets.
 
> Reviewed-by: Namhyung Kim <namhyung@...nel.org>

Cherry picked this first patch to make a bit of progress in the
perf-tools-next front.

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ