[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7b87a1b5-238c-bbe2-ab6f-c0c5d643c18f@linux.dev>
Date: Fri, 25 Aug 2023 13:04:39 -0700
From: Yonghong Song <yonghong.song@...ux.dev>
To: Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
Cc: 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 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@...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.
Thanks, Kees! I can provide a followup soon.
Powered by blists - more mailing lists