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: <4dadf9be-a349-4a19-ae9c-652ade9e2198@suse.cz>
Date: Wed, 2 Oct 2024 14:09:30 +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 1/1] mm/slab: remove duplicate check in create_cache()

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

Hi, sorry for the late reply.
This code was heavily refactored as of 6.12-rc1. Can you check if it's still
the case and send updated patch?
Thanks,
Vlastimil

> ---
>  mm/slab_common.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index 40b582a014b8f2f..3069c9095523484 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -210,9 +210,6 @@ static struct kmem_cache *create_cache(const char *name,
>  	struct kmem_cache *s;
>  	int err;
>  
> -	if (WARN_ON(useroffset + usersize > object_size))
> -		useroffset = usersize = 0;
> -
>  	err = -ENOMEM;
>  	s = kmem_cache_zalloc(kmem_cache, GFP_KERNEL);
>  	if (!s)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ