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: <7d9e6df5-5921-422e-9ef8-4cef3f89b555@intel.com>
Date: Fri, 18 Jul 2025 16:27:08 -0700
From: Dave Jiang <dave.jiang@...el.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
 Dan Williams <dan.j.williams@...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>,
 "Fabio M. De Francesco" <fabio.m.de.francesco@...ux.intel.com>,
 Robert Richter <rrichter@....com>, Li Ming <ming.li@...omail.com>,
 Peter Zijlstra <peterz@...radead.org>, linux-cxl@...r.kernel.org,
 linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] cxl/region: Fix an ERR_PTR() vs NULL bug



On 7/18/25 2:22 PM, Dan Carpenter wrote:
> The __cxl_decoder_detach() function is expected to return NULL on error
> but this error path accidentally returns an error pointer.  It could
> potentially lead to an error pointer dereference in the caller.  Change
> it to return NULL.
> 
> Fixes: b3a88225519c ("cxl/region: Consolidate cxl_decoder_kill_region() and cxl_region_detach()")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>

Thanks Dan!

Applied to cxl/next
49d6e658e758e42aaff8ae5ecdd2d06b29abf53e

> ---
>  drivers/cxl/core/region.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index f0765a0af845..71cc42d05248 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -2108,7 +2108,7 @@ __cxl_decoder_detach(struct cxl_region *cxlr,
>  		if (pos >= p->interleave_ways) {
>  			dev_dbg(&cxlr->dev, "position %d out of range %d\n",
>  				pos, p->interleave_ways);
> -			return ERR_PTR(-ENXIO);
> +			return NULL;
>  		}
>  
>  		if (!p->targets[pos])


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ