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: <YiLg/0be3jp9mg2V@ip-172-31-19-208.ap-northeast-1.compute.internal>
Date:   Sat, 5 Mar 2022 04:03:11 +0000
From:   Hyeonggon Yoo <42.hyeyoo@...il.com>
To:     Vlastimil Babka <vbabka@...e.cz>
Cc:     linux-mm@...ck.org, 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>,
        Marco Elver <elver@...gle.com>,
        Matthew WilCox <willy@...radead.org>,
        Roman Gushchin <roman.gushchin@...ux.dev>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/5] mm/sl[auo]b: move definition of __ksize() to
 mm/slab.h

On Fri, Mar 04, 2022 at 07:29:21PM +0100, Vlastimil Babka wrote:
> On 3/4/22 07:34, Hyeonggon Yoo wrote:
> > __ksize() is only called by KASAN. Remove export symbol and move
> > definition to mm/slab.h as we don't want to grow its callers.
> > 
> > [ willy@...radead.org: Move definition to mm/slab.h and reduce comments ]
> > 
> > Signed-off-by: Hyeonggon Yoo <42.hyeyoo@...il.com>
> 
> Reviewed-by: Vlastimil Babka <vbabka@...e.cz>
>

Thanks!

> > --- a/mm/slab.h
> > +++ b/mm/slab.h
> > @@ -685,6 +685,8 @@ static inline void free_large_kmalloc(struct folio *folio, void *object)
> >  }
> >  #endif /* CONFIG_SLOB */
> >  
> > +size_t __ksize(const void *objp);
> > +
> >  static inline size_t slab_ksize(const struct kmem_cache *s)
> >  {
> >  #ifndef CONFIG_SLUB
> > diff --git a/mm/slab_common.c b/mm/slab_common.c
> > index 1d2f92e871d2..b126fc7247b9 100644
> > --- a/mm/slab_common.c
> > +++ b/mm/slab_common.c
> > @@ -1247,13 +1247,7 @@ EXPORT_SYMBOL(kfree_sensitive);
> >  
> >  #ifndef CONFIG_SLOB
> >  /**
> 
> Maybe just /* so it's not even parsed as a kernel-doc anymore?
>

Oh yes, that would be better.

> > - * __ksize -- Uninstrumented ksize.
> > - * @objp: pointer to the object
> > - *
> > - * Unlike ksize(), __ksize() is uninstrumented, and does not provide the same
> > - * safety checks as ksize() with KASAN instrumentation enabled.
> > - *
> > - * Return: size of the actual memory used by @objp in bytes
> > + * __ksize -- Uninstrumented ksize. Only called by KASAN.
> >   */
> >  size_t __ksize(const void *object)
> >  {
> > @@ -1269,7 +1263,6 @@ size_t __ksize(const void *object)
> >  
> >  	return slab_ksize(folio_slab(folio)->slab_cache);
> >  }
> > -EXPORT_SYMBOL(__ksize);
> >  #endif
> >  

-- 
Thank you, You are awesome!
Hyeonggon :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ