[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a743d8e1-0460-775c-2a21-54a891d6a973@meta.com>
Date: Wed, 12 Jul 2023 23:14:20 -0700
From: Yonghong Song <yhs@...a.com>
To: Kees Cook <keescook@...omium.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Petr Mladek <pmladek@...e.com>, Song Liu <song@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Yonghong Song <yhs@...com>
Cc: Fangrui Song <maskray@...gle.com>, kernel-team@...com,
Leizhen <thunder.leizhen@...wei.com>,
linux-kernel@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH v2] kallsyms: strip LTO-only suffixes from promoted global
functions
On 7/12/23 3:40 PM, Kees Cook wrote:
>
> On Wed, 28 Jun 2023 11:19:26 -0700, Yonghong Song wrote:
>> Commit 6eb4bd92c1ce ("kallsyms: strip LTO suffixes from static functions")
>> stripped all function/variable suffixes started with '.' regardless
>> of whether those suffixes are generated at LTO mode or not. In fact,
>> as far as I know, in LTO mode, when a static function/variable is
>> promoted to the global scope, '.llvm.<...>' suffix is added.
>>
>> The existing mechanism breaks live patch for a LTO kernel even if
>> no <symbol>.llvm.<...> symbols are involved. For example, for the following
>> kernel symbols:
>> $ grep bpf_verifier_vlog /proc/kallsyms
>> ffffffff81549f60 t bpf_verifier_vlog
>> ffffffff8268b430 d bpf_verifier_vlog._entry
>> ffffffff8282a958 d bpf_verifier_vlog._entry_ptr
>> ffffffff82e12a1f d bpf_verifier_vlog.__already_done
>> 'bpf_verifier_vlog' is a static function. '_entry', '_entry_ptr' and
>> '__already_done' are static variables used inside 'bpf_verifier_vlog',
>> so llvm promotes them to file-level static with prefix 'bpf_verifier_vlog.'.
>> Note that the func-level to file-level static function promotion also
>> happens without LTO.
>>
>> [...]
>
> Applied, thanks!
>
> [1/1] kallsyms: strip LTO-only suffixes from promoted global functions
> https://git.kernel.org/kees/c/8cc32a9bbf29
Thanks Kees!
>
> Best regards,
Powered by blists - more mailing lists