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: <ZylKlUqHkzLNwEHA@arm.com>
Date: Mon, 4 Nov 2024 22:28:37 +0000
From: Catalin Marinas <catalin.marinas@....com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Matthew Wilcox <willy@...radead.org>,
	Koichiro Den <koichiro.den@...il.com>,
	Peter Collingbourne <pcc@...gle.com>, cl@...ux.com,
	penberg@...nel.org, rientjes@...gle.com, iamjoonsoo.kim@....com,
	akpm@...ux-foundation.org, roman.gushchin@...ux.dev,
	42.hyeyoo@...il.com, kees@...nel.org, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] mm/slab: fix warning caused by duplicate kmem_cache
 creation in kmem_buckets_create

On Mon, Nov 04, 2024 at 10:22:37PM +0000, Catalin Marinas wrote:
> On Mon, Nov 04, 2024 at 07:16:20PM +0100, Vlastimil Babka wrote:
> > On 11/4/24 19:00, Matthew Wilcox wrote:
> > > On Tue, Nov 05, 2024 at 12:08:37AM +0900, Koichiro Den wrote:
> > >> Commit b035f5a6d852 ("mm: slab: reduce the kmalloc() minimum alignment
> > >> if DMA bouncing possible") reduced ARCH_KMALLOC_MINALIGN to 8 on arm64.
> > >> However, with KASAN_HW_TAGS enabled, arch_slab_minalign() becomes 16.
> > >> This causes kmalloc_caches[*][8] to be aliased to kmalloc_caches[*][16],
> > >> resulting in kmem_buckets_create() attempting to create a kmem_cache for
> > >> size 16 twice. This duplication triggers warnings on boot:
> > > 
> > > Wouldn't this be easier?
> > 
> > They wanted it to depend on actual HW capability / kernel parameter, see
> > d949a8155d13 ("mm: make minimum slab alignment a runtime property")
> > 
> > Also Catalin's commit referenced above was part of the series that made the
> > alignment more dynamic for other cases IIRC. So I doubt we can simply reduce
> > it back to a build-time constant.
> 
> I principle, I wouldn't reduce it back to constant though the 8 vs 16
> difference is not significant. It matter if one enables KASAN_HW_TAGS
> and wants to run it on hardware without MTE, getting the *-8 caches
> back.
> 
> That said, I haven't managed to trigger this warning yet. Do I need
> other config options than KASAN_HW_TAGS and DEBUG_VM?

Ah, I was missing SLAB_BUCKETS. I'll have a look tomorrow.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ