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: <529f8d49b048af53b6b7e82197fe487b687241b3.camel@sipsolutions.net>
Date: Mon, 07 Oct 2024 10:06:15 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Julian Vetter <jvetter@...rayinc.com>, Arnd Bergmann <arnd@...db.de>, 
 Russell King <linux@...linux.org.uk>, Catalin Marinas
 <catalin.marinas@....com>, Will Deacon <will@...nel.org>,  Guo Ren
 <guoren@...nel.org>, Huacai Chen <chenhuacai@...nel.org>, WANG Xuerui
 <kernel@...0n.name>,  Andrew Morton <akpm@...ux-foundation.org>, Geert
 Uytterhoeven <geert@...ux-m68k.org>, Richard Henderson
 <richard.henderson@...aro.org>, Ivan Kokshaysky <ink@...assic.park.msu.ru>,
  Matt Turner <mattst88@...il.com>, "James E . J . Bottomley"
 <James.Bottomley@...senpartnership.com>,  Helge Deller <deller@....de>,
 Yoshinori Sato <ysato@...rs.sourceforge.jp>, Rich Felker <dalias@...c.org>,
 John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,  Richard
 Weinberger <richard@....at>, Anton Ivanov <anton.ivanov@...bridgegreys.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	linux-csky@...r.kernel.org, loongarch@...ts.linux.dev, 
	linux-m68k@...ts.linux-m68k.org, linux-alpha@...r.kernel.org, 
	linux-parisc@...r.kernel.org, linux-sh@...r.kernel.org, 
	linux-um@...ts.infradead.org, linux-arch@...r.kernel.org, Yann Sionneau
	 <ysionneau@...rayinc.com>
Subject: Re: [PATCH v7 09/10] um: Add dummy implementation for IO
 memcpy/memset

On Mon, 2024-10-07 at 09:49 +0200, Julian Vetter wrote:
> 
> > > The um arch is the only architecture that sets the config 'NO_IOMEM',

(you did note this, for the comment below)

> No, I think you're understanding the series correctly. It doesn't work. 
> I will revert this.

OK.

> > You're adding these inlines unconditionally, so if this included
> > logic_io.h, you should get symbol conflicts?
> > 
> > Also not sure these functions should/need to do anything at all, there's
> > no IO memory on ARCH=um in case of not having logic_io.h. Maybe even
> > BUG_ON() or something? It can't be reachable (under correct drivers)
> > since ioremap() always returns NULL (without logic_iomem).

> Thanks. You're right. I added this patch because there was a build robot 
> on some mailinglist building a random config with 'ARCH=um' and with 
> some MTD drivers that actually use memcpy_fromio or memcpy_toio. These 
> drivers are not guarded by a 'depends on HAS_IOMEM'. I thought I could 
> simply fix it by adding stub functions to the um arch. Because I saw 
> there are A LOT of drivers that use IO functions without being guarded 
> by 'depends on HAS_IOMEM'. Not sure though, how to handle this case.

Right, well, as you noted above ARCH=um is the only architecture that
has NO_IOMEM, so I suppose drivers are just broken. But e.g.
kernel/iomem.c is also only ever built if you have HAS_IOMEM, so devm_*
functions related to this are not available.

So I don't know. On the one hand, it feels correct to have NO_IOMEM and
HAS_IOMEM, on the other hand that's a bit of a fight against windmills?


What happens now though? Seems it should _already_ not build with
ARCH=um and memcpy_*io() being used? No, I guess it picked up the asm-
generic version?

Hm. I'm almost thinking we should let such drivers not build, and then
see that they add appropriate HAS_IOMEM dependencies, but ... windmills?

johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ