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]
Date:   Tue, 18 Jul 2023 10:29:37 +0100
From:   Jonathan Cameron <Jonathan.Cameron@...wei.com>
To:     Dave Jiang <dave.jiang@...el.com>
CC:     Breno Leitao <leitao@...ian.org>,
        Davidlohr Bueso <dave@...olabs.net>,
        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>, <leit@...a.com>,
        kernel test robot <lkp@...el.com>,
        "open list:COMPUTE EXPRESS LINK (CXL)" <linux-cxl@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] cxl/acpi: Use printk specifier for resource

On Mon, 17 Jul 2023 09:28:47 -0700
Dave Jiang <dave.jiang@...el.com> wrote:

> On 7/17/23 03:26, Breno Leitao wrote:
> > Commit 3840e10e8dca ("cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()")
> > is using %llx to print resources pointers, but it is incorrect on 32-bits
> > system, causing the following compilation warning on i386:
> > 
> > 	 drivers/cxl/acpi.c:300:4: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') [-Wformat]
> > 
> > Instead of using pointers to the resource, uses the proper printk
> > specifier that knows how to handle the struct "resources".
> > 
> > This is the new format, being printed now:
> > 
> > 	Failed to add decode range: [mem 0x4080000000-0x2baffffffff flags 0x200]
> > 
> > Reported-by: kernel test robot <lkp@...el.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202307151059.2vvBt55H-lkp@intel.com/
> > Fixes: 3840e10e8dca ("cxl/acpi: Fix a use-after-free in cxl_parse_cfmws()")
> > Suggested-by: Dan Williams <dan.j.williams@...el.com>
> > Signed-off-by: Breno Leitao <leitao@...ian.org>  
> 
> Reviewed-by: Dave Jiang <dave.jiang@...el.com>

FWIW
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

> > ---
> >   drivers/cxl/acpi.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
> > index 815b43859c16..d1c559879dcc 100644
> > --- a/drivers/cxl/acpi.c
> > +++ b/drivers/cxl/acpi.c
> > @@ -296,8 +296,7 @@ static int cxl_parse_cfmws(union acpi_subtable_headers *header, void *arg,
> >   	else
> >   		rc = cxl_decoder_autoremove(dev, cxld);
> >   	if (rc) {
> > -		dev_err(dev, "Failed to add decode range [%#llx - %#llx]\n",
> > -			res->start, res->end);
> > +		dev_err(dev, "Failed to add decode range: %pr", res);
> >   		return rc;
> >   	}
> >   	dev_dbg(dev, "add: %s node: %d range [%#llx - %#llx]\n",  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ