public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Kees Cook <keescook@chromium.org>,
	Nick Desaulniers <ndesaulniers@google.com>
Cc: Petr Mladek <pmladek@suse.com>, Song Liu <song@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Fangrui Song <maskray@google.com>,
	kernel-team@fb.com, Leizhen <thunder.leizhen@huawei.com>,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH] kallsyms: Fix kallsyms_selftest failure
Date: Fri, 25 Aug 2023 13:04:39 -0700	[thread overview]
Message-ID: <7b87a1b5-238c-bbe2-ab6f-c0c5d643c18f@linux.dev> (raw)
In-Reply-To: <202308251258.C6770EAA9@keescook>



On 8/25/23 12:59 PM, Kees Cook wrote:
> 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@linux.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.

Thanks, Kees! I can provide a followup soon.

  reply	other threads:[~2023-08-25 20:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25  3:46 [PATCH] kallsyms: Fix kallsyms_selftest failure Yonghong Song
2023-08-25  6:53 ` Song Liu
2023-08-25  7:19 ` Leizhen (ThunderTown)
2023-09-21 10:33   ` Petr Mladek
2023-09-21 12:15     ` Leizhen (ThunderTown)
2023-08-25 17:51 ` Nick Desaulniers
2023-08-25 19:59   ` Kees Cook
2023-08-25 20:04     ` Yonghong Song [this message]
2023-08-25 19:57 ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7b87a1b5-238c-bbe2-ab6f-c0c5d643c18f@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=keescook@chromium.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=maskray@google.com \
    --cc=ndesaulniers@google.com \
    --cc=oliver.sang@intel.com \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=song@kernel.org \
    --cc=thunder.leizhen@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox