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] [day] [month] [year] [list]
Message-ID: <fxpibejx4g6tt7ow2l2qmjbd6adquukkszolqgmjvq4oo2s22e@p6wlptkl74px>
Date: Tue, 3 Sep 2024 12:16:28 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        kernel test robot <lkp@...el.com>, llvm@...ts.linux.dev,
        oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Linux Memory Management List <linux-mm@...ck.org>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>
Subject: Re: lib/maple_tree.c:330:20: error: unused function 'mte_set_full'

* Nathan Chancellor <nathan@...nel.org> [240830 21:28]:
> On Fri, Aug 30, 2024 at 05:50:15PM -0700, Andrew Morton wrote:
> > On Sat, 31 Aug 2024 07:42:38 +0800 kernel test robot <lkp@...el.com> wrote:
> > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > >> lib/maple_tree.c:330:20: error: unused function 'mte_set_full' [-Werror,-Wunused-function]
> > >      330 | static inline void mte_set_full(const struct maple_enode *node)
> > >          |                    ^~~~~~~~~~~~
> > > >> lib/maple_tree.c:335:20: error: unused function 'mte_clear_full' [-Werror,-Wunused-function]
> > >      335 | static inline void mte_clear_full(const struct maple_enode *node)
> > >          |                    ^~~~~~~~~~~~~~
> > >    2 errors generated.
> > 
> > afaict these have never been used.  It's odd that this was just detected.
> 
> I don't think it has just now been detected, as these functions have
> been flagged before:
> 
> https://lore.kernel.org/20240503160821.GB3960118@thelio-3990X/
> 
> > Should we just zap them or is there some reason to retain?
> 
> From the above thread, Liam and Matthew seem to want to retain them.
> Perhaps just wrapping them in '#if 0' and a comment that says these will
> eventually see use would be a happy compromise between outright removal
> and doing nothing about this warning?

Besides these functions being static and inline (And thus compiled out),
they are stopping people from trying to use the bit in the address -
which we have had happen.

I am still working on the code to use these on my side, although I have
been held up with other work upstream.

> 
> > --- a/lib/maple_tree.c~a
> > +++ a/lib/maple_tree.c
> > @@ -348,21 +348,6 @@ static inline void *mte_safe_root(const
> >  	return (void *)((unsigned long)node & ~MAPLE_ROOT_NODE);
> >  }
> >  
> > -static inline void *mte_set_full(const struct maple_enode *node)
> > -{
> > -	return (void *)((unsigned long)node & ~MAPLE_ENODE_NULL);
> > -}
> > -
> > -static inline void *mte_clear_full(const struct maple_enode *node)
> > -{
> > -	return (void *)((unsigned long)node | MAPLE_ENODE_NULL);
> > -}
> > -
> > -static inline bool mte_has_null(const struct maple_enode *node)
> > -{
> > -	return (unsigned long)node & MAPLE_ENODE_NULL;
> > -}
> > -
> >  static __always_inline bool ma_is_root(struct maple_node *node)
> >  {
> >  	return ((unsigned long)node->parent & MA_ROOT_PARENT);
> > _
> > 
> > 
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ