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: <aWaEqW1vP3EEOvYK@rric.localdomain>
Date: Tue, 13 Jan 2026 18:45:13 +0100
From: Robert Richter <rrichter@....com>
To: Dave Jiang <dave.jiang@...el.com>
Cc: Davidlohr Bueso <dave@...olabs.net>,
	Jonathan Cameron <jonathan.cameron@...wei.com>,
	Alison Schofield <alison.schofield@...el.com>,
	Vishal Verma <vishal.l.verma@...el.com>,
	Ira Weiny <ira.weiny@...el.com>,
	Dan Williams <dan.j.williams@...el.com>, linux-cxl@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] cxl: Check for invalid addresses returned from
 translation functions on errors

On 13.01.26 08:51:15, Dave Jiang wrote:
> 
> 
> On 1/7/26 5:05 AM, Robert Richter wrote:
> > Translation functions may return an invalid address in case of errors.
> > If the address is not checked the further use of the invalid value
> > will cause an address corruption.
> > 
> > Consistently check for a valid address returned by translation
> > functions. Use RESOURCE_SIZE_MAX to indicate an invalid address for
> > type resource_size_t. Depending on the type either RESOURCE_SIZE_MAX
> > or ULLONG_MAX is used to indicate an address error.
> > 
> > Reviewed-by: Dave Jiang <dave.jiang@...el.com>
> > Signed-off-by: Robert Richter <rrichter@....com>
> > ---
> > v3:
> >  * updated sob-chain,
> >  * changed error handling flow in test/cxl_translate.c (Alison),
> > 
> > v2:
> >  * separated from this patch series (Alison):
> >    [PATCH v8 00/13] cxl: ACPI PRM Address Translation Support and AMD Zen5 enablement
> >  * improved error handling logic and early return on error in
> >    region_offset_to_dpa_result() (Dave),
> >  * use RESOURCE_SIZE_MAX to indicate an invalid address for
> >    resource_size_t types (Alison, kernel test robot),
> >  * improved patch description (Alison),
> >  * added line wrap for code >80 chars.
> > ---
> > 
> > Signed-off-by: Robert Richter <rrichter@....com>
> 
> Applied to cxl/fixes
> 8441c7d3bd6c5a52ab2ecf77e43a5bf262004f5c

Thanks Alison and Dave.

> Added user impact statement and fixed up tab formatting reported by checkpatch.

> > +		pr_err("test random iter %d FAIL hpa=%llu, dpa=%llu reverse_dpa=%llu, pos=%d reverse_pos=%d eiw=%u eig=%u\n",
> > +			i, hpa, dpa, reverse_dpa, pos, reverse_pos, eiw, eig);

Note that my checkpatch does not trigger a tab issue here. How did you
test that?

Thanks,

-Robert

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ