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 Oct 2022 16:00:57 +0200
From:   Andrey Konovalov <andreyknvl@...il.com>
To:     Feng Tang <feng.tang@...el.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        Hyeonggon Yoo <42.hyeyoo@...il.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Jonathan Corbet <corbet@....net>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        Linux Memory Management List <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        kasan-dev <kasan-dev@...glegroups.com>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v6 2/4] mm/slub: only zero the requested size of buffer
 for kzalloc

On Tue, Sep 27, 2022 at 4:42 AM Feng Tang <feng.tang@...el.com> wrote:
>
> > > @@ -746,7 +747,7 @@ static inline void slab_post_alloc_hook(struct kmem_cache *s,
> > >         for (i = 0; i < size; i++) {
> > >                 p[i] = kasan_slab_alloc(s, p[i], flags, init);
> > >                 if (p[i] && init && !kasan_has_integrated_init())
> > > -                       memset(p[i], 0, s->object_size);
> > > +                       memset(p[i], 0, orig_size);
> >
> > Note that when KASAN is enabled and has integrated init, it will
> > initialize the whole object, which leads to an inconsistency with this
> > change.
>
> Do you mean for kzalloc() only? or there is some kasan check newly added?

Hi Feng,

I mean that when init is true and kasan_has_integrated_init() is true
(with HW_TAGS mode), kasan_slab_alloc() initializes the whole object.
Which is inconsistent with the memset() of only orig_size when
!kasan_has_integrated_init(). But I think this is fine assuming SLAB
poisoning happens later. But please add a comment.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ