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: <aIznPp+sKYJq7vGa@lizhi-Precision-Tower-5810>
Date: Fri, 1 Aug 2025 12:11:42 -0400
From: Frank Li <Frank.li@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Manivannan Sadhasivam <mani@...nel.org>,
	Krzysztof WilczyƄski <kwilczynski@...nel.org>,
	Kishon Vijay Abraham I <kishon@...nel.org>,
	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH next] misc: pci_endpoint_test: Fix array underflow in
 pci_endpoint_test_ioctl()

On Fri, Aug 01, 2025 at 04:34:25PM +0300, Dan Carpenter wrote:
> We recently added NO_BAR (-1) to the pci_barno enum which, in practical

Since commit ...., add NO_BAR (-1) to the pci_barno enum, ...

Frank

> terms, changes the enum from an unsigned int to a signed int.  If the
> user passes a negative number in pci_endpoint_test_ioctl() then it
> results in an array underflow in pci_endpoint_test_bar().
>
> Fixes: eefb83790a0d ("misc: pci_endpoint_test: Add doorbell test case")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  drivers/misc/pci_endpoint_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c
> index 1c156a3f845e..f935175d8bf5 100644
> --- a/drivers/misc/pci_endpoint_test.c
> +++ b/drivers/misc/pci_endpoint_test.c
> @@ -937,7 +937,7 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd,
>  	switch (cmd) {
>  	case PCITEST_BAR:
>  		bar = arg;
> -		if (bar > BAR_5)
> +		if (bar <= NO_BAR || bar > BAR_5)
>  			goto ret;
>  		if (is_am654_pci_dev(pdev) && bar == BAR_0)
>  			goto ret;
> --
> 2.47.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ