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]
Date: Thu, 16 May 2024 17:13:00 +0200
From: Thorsten Blum <thorsten.blum@...lux.com>
To: Andrew Lunn <andrew@...n.ch>
Cc: Nicolas Pitre <nico@...xnic.net>,
 "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>,
 John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
 Arnd Bergmann <arnd@...db.de>,
 netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org,
 kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] net: smc91x: Fix pointer types

On 16. May 2024, at 16:13, Andrew Lunn <andrew@...n.ch> wrote:
> -#define SMC_PUSH_DATA(lp, p, l) \
>> +#define SMC_PUSH_DATA(lp, p, l) \
>> do { \
>> - if (SMC_32BIT(lp)) { \
>> + void __iomem *__ioaddr = ioaddr; \
> 
> ioaddr is not a parameter passed to this macro.

Yes, most (all?) macros in this file rely on ioaddr being implicitly
defined in the surrounding scope.

> + if (SMC_32BIT(lp)) { \
>> void *__ptr = (p); \
>> int __len = (l); \
>> - void __iomem *__ioaddr = ioaddr; \
>> if (__len >= 2 && (unsigned long)__ptr & 2) { \
>> __len -= 2; \
>> - SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \
>> + SMC_outsw(__ioaddr, DATA_REG(lp), __ptr, 1); \
> 
> You probably should use lp->base here, which is passed into this
> macro, and should have the correct type.

ioaddr is lp->base:

	void __iomem *ioaddr = lp->base;

but the type information for ioaddr gets lost across multiple macro
boundaries which is why either __ioaddr or lp->base must be used when
calling the SMC_* macros. Both __ioaddr and lp->base work, but I guess
you prefer lp->base? I'm fine with both.

> @@ -1072,7 +1072,7 @@ static const char * chip_ids[ 16 ] =  {
>> */ \
>> __ptr -= 2; \
>> __len += 2; \
>> - SMC_SET_PTR(lp, \
>> + SMC_SET_PTR(lp, \
>> 2|PTR_READ|PTR_RCV|PTR_AUTOINC); \
>> } \
>> if (SMC_CAN_USE_DATACS && lp->datacs) \
> 
> This is just a whitespace change. Please put that into a different
> patch.

Ok, I'll change this in v2.

Thanks,
Thorsten

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ