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: <20250224154309.GA465854@bhelgaas>
Date: Mon, 24 Feb 2025 09:43:09 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Ashish Kalra <Ashish.Kalra@....com>
Cc: bhelgaas@...gle.com, ilpo.jarvinen@...ux.intel.com,
	alex.williamson@...hat.com, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PCI: fix bug introduced in pci_save_pcix_state()

On Sun, Feb 23, 2025 at 05:07:00AM +0000, Ashish Kalra wrote:
> From: Ashish Kalra <ashish.kalra@....com>
> 
> For PCIe devices which don't have PCI_CAP_ID_PCIX, this change in
> pci_save_pcix_state() causes pci_save_state() to return -ENOMEM error
> and causes e1000e driver probe to fail as follows:
> ..
> [   15.891676] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
> [   15.921816] e1000e 0000:21:00.0: probe with driver e1000e failed with error -12
> ...
> 
> Fixes: 7d90d8d2bb1b ("PCI: Avoid pointless capability searches")
> Signed-off-by: Ashish Kalra <ashish.kalra@....com>

I dropped that patch for now, so if you're using current -next you
shouldn't see this issue.

> ---
>  drivers/pci/pci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index ccd029339079..685463ea392b 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1743,14 +1743,14 @@ static int pci_save_pcix_state(struct pci_dev *dev)
>  	struct pci_cap_saved_state *save_state;
>  	u8 pos;
>  
> -	save_state = pci_find_saved_cap(dev, PCI_CAP_ID_PCIX);
> -	if (!save_state)
> -		return -ENOMEM;
> -
>  	pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
>  	if (!pos)
>  		return 0;
>  
> +	save_state = pci_find_saved_cap(dev, PCI_CAP_ID_PCIX);
> +	if (!save_state)
> +		return -ENOMEM;
> +
>  	pci_read_config_word(dev, pos + PCI_X_CMD,
>  			     (u16 *)save_state->cap.data);
>  
> -- 
> 2.34.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ