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]
Date: Mon, 27 May 2024 09:15:10 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Christoph Lameter <cl@...ux.com>, David Rientjes <rientjes@...gle.com>, 
	Andrew Morton <akpm@...ux-foundation.org>, Roman Gushchin <roman.gushchin@...ux.dev>, 
	Hyeonggon Yoo <42.hyeyoo@...il.com>, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	Suren Baghdasaryan <surenb@...gle.com>, Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2] mm, slab: don't wrap internal functions with
 alloc_hooks()

On Mon, May 27, 2024 at 11:01:28AM +0200, Vlastimil Babka wrote:
> The functions __kmalloc_noprof(), kmalloc_large_noprof(),
> kmalloc_trace_noprof() and their _node variants are all internal to the
> implementations of kmalloc_noprof() and kmalloc_node_noprof() and are
> only declared in the "public" slab.h and exported so that those
> implementations can be static inline and distinguish the build-time
> constant size variants. The only other users for some of the internal
> functions are slub_kunit and fortify_kunit tests which make very
> short-lived allocations.
> 
> Therefore we can stop wrapping them with the alloc_hooks() macro.
> Instead add a __ prefix to all of them and a comment documenting these
> as internal. Also rename __kmalloc_trace() to __kmalloc_cache() which is
> more descriptive - it is a variant of __kmalloc() where the exact
> kmalloc cache has been already determined.
> 
> The usage in fortify_kunit can be removed completely, as the internal
> functions should be tested already through kmalloc() tests in the
> test variant that passes non-constant allocation size.
> 
> Reported-by: Kent Overstreet <kent.overstreet@...ux.dev>
> Cc: Suren Baghdasaryan <surenb@...gle.com>
> Cc: Kees Cook <keescook@...omium.org>
> Signed-off-by: Vlastimil Babka <vbabka@...e.cz>

Reviewed-by: Kent Overstreet <kent.overstreet@...ux.dev>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ