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: <1625e2e0-06ad-459c-b941-41fadea2008d@suse.cz>
Date: Thu, 24 Oct 2024 11:08:38 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Chen Ridong <chenridong@...weicloud.com>,
 Roman Gushchin <roman.gushchin@...ux.dev>, akpm@...ux-foundation.org,
 david@...morbit.com
Cc: Muchun Song <muchun.song@...ux.dev>,
 Anshuman Khandual <anshuman.khandual@....com>,
 "Kirill A. Shutemov" <kirill@...temov.name>, zhengqi.arch@...edance.com,
 linux-mm@...ck.org, linux-kernel@...r.kernel.org, wangweiyang2@...wei.com
Subject: Re: [PATCH v2] mm: shrinker: avoid memleak in alloc_shrinker_info

On 10/24/24 03:26, Chen Ridong wrote:
>>>> For example, if we use his v1 proposal, we should do
>>>> the cleanups again for info. But for goto-based
>>>> version, we just add another label to do the
>>>> cleanups and go to the new label for failure case. goto-based fix is what I insisted on. I copied my previous suggested fix here to clarify my opinion.
>>>
>>> Again, info is a loop-iteration-local variable, v1 fix making it truly local
>>> is the way to go. If there are further cleanups added in the loop itself in
>>> the future, they could hopefully keep being local to the loop as well.
>>> Cleanup of info outside the loop iteration is breaking its real scope.
>> 
>> +1 to that.
>> 
>> I don't think it's such a big deal and both versions are ok, but I strongly
>> prefer the original version (without introduction of a new label).
>> 
>> Please, feel free to use
>> Acked-by: Roman Gushchin <roman.gushchin@...ux.dev>
>> with the original version.
>> 
>> Thanks!
> 
> I agree with Roman.
> Hello, Andrew and Dave, Do you have any opinions?
> 
> The original version:
> https://lore.kernel.org/linux-kernel/4184c61f-80f7-4adc-8929-c29f959cb8df@huawei.com/

Hi,

Can you resend the v1 as v3, but also move the declaration of "struct
shrinker_info *info;" inside the for_each_node() block? Also you can add all
the acks collected for that version and mine too:

Acked-by: Vlastimil Babka <vbabka@...e.cz>

Thanks.

> Best regards,
> Ridong
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ