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: <20210513123822.GA776220@hyeyoo>
Date:   Thu, 13 May 2021 21:38:22 +0900
From:   Hyeonggon Yoo <42.hyeyoo@...il.com>
To:     Marco Elver <elver@...gle.com>
Cc:     Vlastimil Babka <vbabka@...e.cz>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        David Rientjes <rientjes@...gle.com>,
        Pekka Enberg <penberg@...nel.org>,
        Christoph Lameter <cl@...ux.com>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] mm, slub: change run-time assertion in
 kmalloc_index() to compile-time

On Thu, May 13, 2021 at 02:29:13PM +0200, Marco Elver wrote:
> On Thu, 13 May 2021 at 14:03, Hyeonggon Yoo <42.hyeyoo@...il.com> wrote:
> > On Thu, May 13, 2021 at 12:31:38PM +0200, Marco Elver wrote:
> [...]
> > what about checking size it on top of kmalloc_index? because by definition of
> > KMALLOC_SHIFT_HIGH, it's not always 25. it can be less than 25. for some
> > situations.
> >
> > below is what I suggested beofre. for just reference:
> 
> This doesn't solve the problem. We want the compiler to complain
> whenever kmalloc_index() is used with non-constant in normal code.

in the beginning, I thought kmalloc_index is called only from kmalloc.
but if kmalloc_index is called from other place, I think it should
correctly check its size. that's what kmalloc_index should do.

or... should it be solved as another patch?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ