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: <e8a845d4-bab7-33ae-07e9-89c38e6f19cc@huawei.com>
Date: Sat, 12 Oct 2024 09:50:45 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To: Thomas Gleixner <tglx@...utronix.de>, LKML <linux-kernel@...r.kernel.org>
CC: Waiman Long <longman@...hat.com>
Subject: Re: [patch 03/25] debugobjects: Dont destroy kmem cache in init()



On 2024/10/12 4:37, Thomas Gleixner wrote:
> On Thu, Oct 10 2024 at 21:31, Leizhen wrote:
>> On 2024/10/10 19:46, Thomas Gleixner wrote:
>>> On Thu, Oct 10 2024 at 10:14, Leizhen wrote:
>>>> On 2024/10/8 0:49, Thomas Gleixner wrote:
>>>>> -	if (!obj_cache || debug_objects_replace_static_objects()) {
>>>>> +	if (!cache || !debug_objects_replace_static_objects(cache)) {
>>>>>  		debug_objects_enabled = 0;
>>>>> -		kmem_cache_destroy(obj_cache);
>>>>
>>>> kmem_cache_destroy(cache) should be kept, or move it into debug_objects_replace_static_objects()
>>>> and place it above 'return false'.
>>>
>>> At that point it can't be destroyed. See the backtrace.
>>>
>>> So we just give the objects back and leak the kmem_cache.
>>
>> Oh, sorry, I didn't figure it out before, but now I do.
>> But shouldn't we add kmemleak_ignore(cache) ?
> 
> I don't know if it's worth the trouble. With the follow up changes the
> only reason why this can happen is that the static object conversion
> cannot allocate memory. Leaking the kmemcache in that case is the least
> of the worries.
> 
> I just tripped over that back trace because I intentionally triggered
> the error path.

Yes, that's an error path that almost never goes to.
OK, so keep it still.

> 
> Thanks,
> 
>         tglx
> 
> 
> .
> 

-- 
Regards,
  Zhen Lei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ