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: <nycvar.YFH.7.76.2402281011470.21798@cbobk.fhfr.pm>
Date: Wed, 28 Feb 2024 10:20:13 +0100 (CET)
From: Jiri Kosina <jikos@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
cc: Bjorn Helgaas <helgaas@...nel.org>, 
    Carlos López <clopez@...e.de>, cve@...nel.org, 
    linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>, 
    Jonas Gorski <jonas.gorski@...il.com>, 
    Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, 
    Mika Westerberg <mika.westerberg@...ux.intel.com>
Subject: Re: CVE-2023-52466: PCI: Avoid potential out-of-bounds read in
 pci_dev_for_each_resource()

On Tue, 27 Feb 2024, Greg Kroah-Hartman wrote:

> > 09cc90063240 ("PCI: Introduce pci_dev_for_each_resource()") added
> > pci_dev_for_each_resource(), which expands to:
> > 
> >   for (...; res = (&(dev)->resource[(bar)]), bar < PCI_NUM_RESOURCES; ...)
> > 
> > We compute "res" before the bounds-check of "bar", so the pointer may
> > be out-of-bounds, but the body of the pci_dev_for_each_resource() loop
> > is never executed with that out-of-bounds value.
> > 
> > So I don't think this is a security issue, no matter how
> > pci_dev_for_each_resource() is used, unless the mere presence of an
> > invalid address in a register is an issue.
> 
> Ah, yeah, now I remember, stuff like this was fixed up in other loops as
> just reading off into the wild can be a speculation issue and so we had
> to fix up a bunch of places in the kernel where we did have "invalid
> data" in a register.  The code didn't use that, but the processor would
> fetch from there, and boom, speculation mess.  There's a whole research
> paper published on this type of thing somewhere...

Greg, could you please elaborate on this?

Where in this whole construct do you see a potential for *_uncached_* (!) 
memory access that'd cause CPU to speculate into the wild? I just don't 
see it.

Thanks,

-- 
Jiri Kosina
SUSE Labs


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ