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]
Date:   Thu, 13 May 2021 21:08:29 +0900
From:   Hyeonggon Yoo <42.hyeyoo@...il.com>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     Marco Elver <elver@...gle.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        iamjoonsoo.kim@....com, rientjes@...gle.com, penberg@...nel.org,
        cl@...ux.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        42.hyeyoo@...il.com
Subject: Re: [PATCH v3] mm, slub: change run-time assertion in
 kmalloc_index() to compile-time

On Thu, May 13, 2021 at 01:37:38PM +0200, Vlastimil Babka wrote:
> > See my suggestion below that builds on Andrew's size_is_constant but
> > would retain the old interface and support testing.
> 
> I can accept that, but please also modify/expand the newly added comment. Now
> it's *normally* evaluated in compile-time. And there should be warning that
> anyone calling it with size_is_constant == false should do that only in context
> where performance (and code bloat, most likely too) doesn't matter, such as unit
> test.
> 
> Thanks, Vlastimil
> 
> > Thanks,

I completely agree on what Vlastimil said. there should be comment
saying that generally you should not use kmalloc_index with
size_is_const == true.

and the caller MUST guarantee that size_is_const is correct.
if not, it would be so confusing.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ