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: <202308251258.C6770EAA9@keescook>
Date:   Fri, 25 Aug 2023 12:59:43 -0700
From:   Kees Cook <keescook@...omium.org>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Yonghong Song <yonghong.song@...ux.dev>,
        Petr Mladek <pmladek@...e.com>, Song Liu <song@...nel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        Fangrui Song <maskray@...gle.com>, kernel-team@...com,
        Leizhen <thunder.leizhen@...wei.com>,
        linux-kernel@...r.kernel.org, llvm@...ts.linux.dev,
        kernel test robot <oliver.sang@...el.com>
Subject: Re: [PATCH] kallsyms: Fix kallsyms_selftest failure

On Fri, Aug 25, 2023 at 10:51:58AM -0700, Nick Desaulniers wrote:
> On Thu, Aug 24, 2023 at 8:49 PM Yonghong Song <yonghong.song@...ux.dev> wrote:
> >
> > diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> > index 016d997131d4..e12d26c10dba 100644
> > --- a/kernel/kallsyms.c
> > +++ b/kernel/kallsyms.c
> > @@ -188,16 +188,13 @@ static bool cleanup_symbol_name(char *s)
> >
> >  static int compare_symbol_name(const char *name, char *namebuf)
> >  {
> > -       int ret;
> > -
> > -       ret = strcmp(name, namebuf);
> > -       if (!ret)
> > -               return ret;
> > -
> > -       if (cleanup_symbol_name(namebuf) && !strcmp(name, namebuf))
> > -               return 0;
> > -
> > -       return ret;
> > +       /* The kallsyms_seqs_of_names is sorted based on names after
> > +        * cleanup_symbol_name() (see scripts/kallsyms.c) if clang lto is enabled.
> > +        * To ensure correct bisection in kallsyms_lookup_names(), do
> > +        * cleanup_symbol_name(namebuf) before comparing name and namebuf.
> > +        */
> > +       cleanup_symbol_name(namebuf);
> 
> Hi Yonghong,
> Thanks for your work on this patch.
> So if this change is removing the last place where the return value of
> cleanup_symbol_name is checked, then perhaps this commit should
> additionally change the function signature of cleanup_symbol_name to
> have `void` return type.

I've landed this in -next as-is just because I want to make sure the bug
gets fixed ASAP, so if this gets adjusted, I can just include that
change on top.

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ