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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1e9500de-3388-402d-84a3-cebca7bc24df@astralinux.ru>
Date: Mon, 2 Sep 2024 17:14:34 +0300
From: Alexandra Diupina <adiupina@...ralinux.ru>
To: Xiaowei Song <songxiaowei@...ilicon.com>
Cc: Binghui Wang <wangbinghui@...ilicon.com>,
 Lorenzo Pieralisi <lpieralisi@...nel.org>,
 Krzysztof Wilczyński <kw@...ux.com>,
 Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
 Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
 linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
 lvc-project@...uxtesting.org
Subject: Re: [PATCH v2] PCI: kirin: Fix buffer overflow

just a friendly reminder


19/07/24 15:21, Alexandra Diupina пишет:
> In kirin_pcie_parse_port() pcie->num_slots is compared to
> pcie->gpio_id_reset size (MAX_PCI_SLOTS). Need to fix
> condition to pcie->num_slots + 1 >= MAX_PCI_SLOTS and move
> pcie->num_slots increment lower to avoid out-of-bounds
> array access.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: b22dbbb24571 ("PCI: kirin: Support PERST# GPIOs for HiKey970 external PEX 8606 bridge")
> Signed-off-by: Alexandra Diupina <adiupina@...ralinux.ru>
> ---
> v2: some changes
>   drivers/pci/controller/dwc/pcie-kirin.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
> index d5523f302102..deab1e653b9a 100644
> --- a/drivers/pci/controller/dwc/pcie-kirin.c
> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
> @@ -412,12 +412,12 @@ static int kirin_pcie_parse_port(struct kirin_pcie *pcie,
>   			if (pcie->gpio_id_reset[i] < 0)
>   				continue;
>   
> -			pcie->num_slots++;
> -			if (pcie->num_slots > MAX_PCI_SLOTS) {
> +			if (pcie->num_slots + 1 >= MAX_PCI_SLOTS) {
>   				dev_err(dev, "Too many PCI slots!\n");
>   				ret = -EINVAL;
>   				goto put_node;
>   			}
> +			pcie->num_slots++;
>   
>   			ret = of_pci_get_devfn(child);
>   			if (ret < 0) {


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ