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]
Date:	Sun, 06 Dec 2009 10:33:09 +0200
From:	Pekka Enberg <penberg@...helsinki.fi>
To:	Catalin Marinas <catalin.marinas@....com>
CC:	"J. R. Okajima" <hooanon05@...oo.co.jp>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] slab, kmemleak, bugfix, pass the correct pointer
 to kmemleak_erase()

Catalin Marinas wrote:
> "J. R. Okajima" <hooanon05@...oo.co.jp> wrote:
>> In ____cache_alloc(), the variable 'ac' may be changed after
>> cache_alloc_refill() and the following kmemleak_erase() may get an
>> incorrect pointer.
>> Update 'ac' after cache_alloc_refill() unconditionally.
>> cf. http://marc.info/?l=linux-kernel&m=125873373124187&w=2
>>     and its thread.
>>
>> Cc: Pekka Enberg <penberg@...helsinki.fi>
>> Cc: Catalin Marinas <catalin.marinas@....com>
>>
>> Signed-off-by: J. R. Okajima <hooanon05@...oo.co.jp>
>> ---
>>  mm/slab.c |    5 +++++
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/mm/slab.c b/mm/slab.c
>> index 4e61449..66e9047 100644
>> --- a/mm/slab.c
>> +++ b/mm/slab.c
>> @@ -3103,6 +3103,11 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
>>  	} else {
>>  		STATS_INC_ALLOCMISS(cachep);
>>  		objp = cache_alloc_refill(cachep, flags);
>> +		/*
>> +		 * the 'ac' may be updated by cache_alloc_refill(),
>> +		 * and kmemleak_erase() requires its correct value.
>> +		 */
>> +		ac = cpu_cache_get(cachep);
>>  	}
>>  	/*
>>  	 * To avoid a false negative, if an object that is in one of the
> 
> Acked-by: Catalin Marinas <catalin.marinas@....com>
> 
> Thanks.

Applied, thanks!
--
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