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: <26f13bdf-72fa-4400-84eb-2f876ff1e218@suse.cz>
Date: Wed, 9 Oct 2024 12:59:36 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Zhen Lei <thunder.leizhen@...wei.com>, Christoph Lameter <cl@...ux.com>,
 Pekka Enberg <penberg@...nel.org>, David Rientjes <rientjes@...gle.com>,
 Joonsoo Kim <iamjoonsoo.kim@....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
Subject: Re: [PATCH v2 1/1] mm/slab: remove duplicate check in create_cache()

On 10/9/24 05:54, Zhen Lei wrote:
> The WARN_ON() check in static function create_cache() is done by its only
> parent __kmem_cache_create_args() before calling it.
> 	if (... ||
> 	    WARN_ON(... ||
> 		    object_size - args->usersize < args->useroffset))
> 		args->usersize = args->useroffset = 0;
> 	...
> 	s = create_cache(cache_name, object_size, args, flags);
> 
> Therefore, the WARN_ON() check in create_cache() can be safely removed.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>

Added to slab/for-next, thanks.

> ---
>  mm/slab_common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> v1 --> v2:
> Updates based on the latest v6.12-rc2.
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 3d26c257ed8b57c..88aa64fc8cd2742 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -222,9 +222,6 @@ static struct kmem_cache *create_cache(const char *name,
>  	struct kmem_cache *s;
>  	int err;
>  
> -	if (WARN_ON(args->useroffset + args->usersize > object_size))
> -		args->useroffset = args->usersize = 0;
> -
>  	/* If a custom freelist pointer is requested make sure it's sane. */
>  	err = -EINVAL;
>  	if (args->use_freeptr_offset &&


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ