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: <885058ae-605b-46e6-989b-3ff52908e6fd@lunn.ch>
Date: Wed, 12 Feb 2025 19:13:42 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Philipp Stanner <phasta@...nel.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Maxime Coquelin <mcoquelin.stm32@...il.com>,
	Alexandre Torgue <alexandre.torgue@...s.st.com>,
	Serge Semin <fancer.lancer@...il.com>,
	Huacai Chen <chenhuacai@...nel.org>,
	Yinggang Gu <guyinggang@...ngson.cn>,
	Yanteng Si <si.yanteng@...ux.dev>,
	Philipp Stanner <pstanner@...hat.com>, netdev@...r.kernel.org,
	linux-stm32@...md-mailman.stormreply.com,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] stmmac: Replace deprecated PCI functions

>  	/* Get the base address of device */
> -	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
> -		if (pci_resource_len(pdev, i) == 0)
> -			continue;
> -		ret = pcim_iomap_regions(pdev, BIT(0), pci_name(pdev));
> -		if (ret)
> -			goto err_disable_device;
> -		break;
> -	}
> -
> -	memset(&res, 0, sizeof(res));
> -	res.addr = pcim_iomap_table(pdev)[0];
> +	res.addr = pcim_iomap_region(pdev, 0, DRIVER_NAME);

I don't know too much about PCI, but this change does not look
obviously correct to me. Maybe the commit message needs expanding to
explain why the loop can be thrown away? Also, is that BIT(0) actually
wrong, it should of been BIT(i)? Is that why the loop is pointless and
can be removed? If so, we should be asking the developer of this code
what are the implications of the bug. Should the loop be kept?

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ