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: <0ca2f22a-8247-8419-3f99-4456a4c7344a@suse.cz>
Date:   Mon, 1 Aug 2022 15:36:48 +0200
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Hyeonggon Yoo <42.hyeyoo@...il.com>
Cc:     Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Joe Perches <joe@...ches.com>,
        Vasily Averin <vasily.averin@...ux.dev>,
        Matthew WilCox <willy@...radead.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 06/15] mm/slab_common: fold kmalloc_order_trace() into
 kmalloc_large()

On 8/1/22 15:26, Hyeonggon Yoo wrote:
> On Thu, Jul 28, 2022 at 05:23:29PM +0200, Vlastimil Babka wrote:
>> On 7/12/22 15:39, Hyeonggon Yoo wrote:
>> > There is no caller of kmalloc_order_trace() except kmalloc_large().
>> > Fold it into kmalloc_large() and remove kmalloc_order{,_trace}().
>> > 
>> > Also add tracepoint in kmalloc_large() that was previously
>> > in kmalloc_order_trace().
>> > 
>> > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
>> > Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
>> 
> 
> Thank you for review.
> 
>> Hmm noticed a small change in how we call trace_kmalloc() which will now
>> include the __GFP_COMP.
> 
> Good catch.
> 
>> I think we could just call alloc_pages() from
>> kmalloc_large() with flags | __GFP_COMP instead of doing flags |=
>> __GFP_COMP; first.
> 
> I'll consider that in next version.
> 
>> AFAICS both kasan_kmalloc_large() and kmemleak_alloc()
>> will filter it out anyway.
> 
> AFAIK not passing __GFP_COMP to both kasan_kmalloc_large()
> and kmemleak_alloc() will affect their behavior.

You mean "will NOT affect...", right?

> - kasan_kmalloc_large() only checks if flag has __GFP_DIRECT_RECLAIM,
> - kmemleak_alloc() only use it to allocate kmemleak_object from
>   slab/pool, which does not require __GFP_COMP.
> 
> simply calling
> 	alloc_pages() with flags | GFP_COMP
> 	kasan_kmalloc_large() with flags
> 	kmemleak_alloc() with flags
> 	trace_kmalloc() with flags
> will be okay.
> 
> BTW this is fixed after patch 9.

Ah, right. __kmalloc_large_node_notrace() does the same  flags |=
__GFP_COMP; but the tracepoint is outside and unaffected.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ