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: <22a46f43-d60c-465d-9ae7-4d84ca9108d4@suse.com>
Date: Thu, 27 Feb 2025 09:23:35 +0100
From: Jan Beulich <jbeulich@...e.com>
To: Jason Andryuk <jason.andryuk@....com>
Cc: stable@...r.kernel.org, xen-devel@...ts.xenproject.org,
 linux-kernel@...r.kernel.org, Juergen Gross <jgross@...e.com>,
 Stefano Stabellini <sstabellini@...nel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
 Jiqian Chen <Jiqian.Chen@....com>, Huang Rui <ray.huang@....com>
Subject: Re: [PATCH] xen/pciback: Make missing GSI non-fatal

On 26.02.2025 21:01, Jason Andryuk wrote:
> A PCI may not have a legacy IRQ.  In that case, do not fail assigning

Nit: Missing "device".

> to the pciback stub.  Instead just skip xen_pvh_setup_gsi().
> 
> This will leave psdev->gsi == -1.  In that case, when reading the value
> via IOCTL_PRIVCMD_PCIDEV_GET_GSI, return -ENOENT.  Userspace can used

Nit: "use".

> this to distinquish from other errors.

Nit: "distinguish".

> --- a/drivers/xen/acpi.c
> +++ b/drivers/xen/acpi.c
> @@ -101,7 +101,7 @@ int xen_acpi_get_gsi_info(struct pci_dev *dev,
>  
>  	pin = dev->pin;
>  	if (!pin)
> -		return -EINVAL;
> +		return -ENOENT;
>  
>  	entry = acpi_pci_irq_lookup(dev, pin);
>  	if (entry) {

While I can understand this change, ...

> @@ -116,7 +116,7 @@ int xen_acpi_get_gsi_info(struct pci_dev *dev,
>  		gsi = -1;
>  
>  	if (gsi < 0)
> -		return -EINVAL;
> +		return -ENOENT;
>  
>  	*gsi_out = gsi;
>  	*trigger_out = trigger;

... I'd expect this needs to keep using an error code other than ENOENT.
Aiui this path means the device has a pin-based interrupt, just that it's
not configured correctly. In which case we'd better not allow the device
to be handed to a guest. Unless there's logic in place (somewhere) to
make sure it then would get to see a device without pin-based interrupt.

> --- a/drivers/xen/xen-pciback/pci_stub.c
> +++ b/drivers/xen/xen-pciback/pci_stub.c
> @@ -240,6 +240,9 @@ static int pcistub_get_gsi_from_sbdf(unsigned int sbdf)
>  	if (!psdev)
>  		return -ENODEV;
>  
> +	if (psdev->gsi == -1)
> +		return -ENOENT;

This may, aiui, mean either of the two situations above. They would then
need distinguishing, too, if user space is intended to derive decisions
from the error code it gets.

Jan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ