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: <4c8aa38f-a427-bd56-4224-7217af7f9a74@suse.cz>
Date:   Wed, 6 Apr 2022 11:09:11 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     David Rientjes <rientjes@...gle.com>
Cc:     Christoph Lameter <cl@...ux.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Pekka Enberg <penberg@...nel.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        patches@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Oliver Glitta <glittao@...il.com>,
        Marco Elver <elver@...gle.com>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Hyeonggon Yoo <42.hyeyoo@...il.com>,
        Imran Khan <imran.f.khan@...cle.com>
Subject: Re: [PATCH v3 4/6] mm/slub: distinguish and print stack traces in
 debugfs files

On 4/5/22 23:40, David Rientjes wrote:
>> @@ -5116,9 +5117,13 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
>>  {
>>  	long start, end, pos;
>>  	struct location *l;
>> -	unsigned long caddr;
>> +	unsigned long caddr, chandle;
>>  	unsigned long age = jiffies - track->when;
>> +	depot_stack_handle_t handle = 0;
>>  
>> +#ifdef CONFIG_STACKDEPOT
>> +	handle = READ_ONCE(track->handle);
>> +#endif
>>  	start = -1;
>>  	end = t->count;
>>  
>> @@ -5133,7 +5138,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
>>  			break;
>>  
>>  		caddr = t->loc[pos].addr;
>> -		if (track->addr == caddr) {
>> +		chandle = t->loc[pos].handle;
>> +		if ((track->addr == caddr) && (handle == chandle)) {
>>  
>>  			l = &t->loc[pos];
>>  			l->count++;
>> @@ -5158,6 +5164,8 @@ static int add_location(struct loc_track *t, struct kmem_cache *s,
>>  
>>  		if (track->addr < caddr)
>>  			end = pos;
>> +		else if (track->addr == caddr && handle < chandle)
>> +			end = pos;
>>  		else
>>  			start = pos;
>>  	}
> 
> Does this need to properly handle the case where handle == NULL?

Hm I can't think of how much more properly is possible. If objects have same
track->addr (which is the immediate caller) and also same NULL handle, they
will be counted together. I think it's the best we can do?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ