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, 2 Jul 2012 14:00:42 +0400
From:	Glauber Costa <glommer@...allels.com>
To:	Feng Tang <feng.tang@...el.com>
CC:	<penberg@...nel.org>, <linux-kernel@...r.kernel.org>,
	<fengguang.wu@...el.com>, <sfr@...b.auug.org.au>,
	<linux-mm@...ck.org>, Christoph Lameter <cl@...ux.com>
Subject: Re: [PATCH] slab: Fix a tpyo in commit 8c138b "slab: Get rid of obj_size
 macro"

On 07/02/2012 10:29 AM, Feng Tang wrote:
> Commit  8c138b only sits in Pekka's and linux-next tree now, which tries
> to replace obj_size(cachep) with cachep->object_size, but has a typo in
> kmem_cache_free() by using "size" instead of "object_size", which casues
> some regressions.
> 
> Reported-and-tested-by: Fengguang Wu <wfg@...ux.intel.com>
> Signed-off-by: Feng Tang <feng.tang@...el.com>
> Cc: Christoph Lameter <cl@...ux.com>
> ---
>  mm/slab.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 64c3d03..605b3b7 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -3890,7 +3890,7 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
>  	unsigned long flags;
>  
>  	local_irq_save(flags);
> -	debug_check_no_locks_freed(objp, cachep->size);
> +	debug_check_no_locks_freed(objp, cachep->object_size);
>  	if (!(cachep->flags & SLAB_DEBUG_OBJECTS))
>  		debug_check_no_obj_freed(objp, cachep->object_size);
>  	__cache_free(cachep, objp, __builtin_return_address(0));
> 

I saw another bug in a patch that ended up not getting in, and was
reported to Christoph, that was exactly due to a typo between size and
object-size.

So first:

Acked-by: Glauber Costa <glommer@...allels.com>

But this also means that that confusion can have been made in other
points. I suggest we take an extensive look into that to make sure there
aren't more.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ