lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v10 05/27] kallsyms: increase maximum kernel symbol length to 512
    On Tue, Sep 27, 2022 at 03:14:36PM +0200, Miguel Ojeda wrote:
    > Rust symbols can become quite long due to namespacing introduced
    > by modules, types, traits, generics, etc. For instance,
    > the following code:
    >
    > pub mod my_module {
    > pub struct MyType;
    > pub struct MyGenericType<T>(T);
    >
    > pub trait MyTrait {
    > fn my_method() -> u32;
    > }
    >
    > impl MyTrait for MyGenericType<MyType> {
    > fn my_method() -> u32 {
    > 42
    > }
    > }
    > }
    >
    > generates a symbol of length 96 when using the upcoming v0 mangling scheme:
    >
    > _RNvXNtCshGpAVYOtgW1_7example9my_moduleINtB2_13MyGenericTypeNtB2_6MyTypeENtB2_7MyTrait9my_method
    >
    > At the moment, Rust symbols may reach up to 300 in length.
    > Setting 512 as the maximum seems like a reasonable choice to
    > keep some headroom.
    >
    > Reviewed-by: Kees Cook <keescook@chromium.org>
    > Reviewed-by: Petr Mladek <pmladek@suse.com>
    > Co-developed-by: Alex Gaynor <alex.gaynor@gmail.com>
    > Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
    > Co-developed-by: Wedson Almeida Filho <wedsonaf@google.com>
    > Signed-off-by: Wedson Almeida Filho <wedsonaf@google.com>
    > Co-developed-by: Gary Guo <gary@garyguo.net>
    > Signed-off-by: Gary Guo <gary@garyguo.net>
    > Co-developed-by: Boqun Feng <boqun.feng@gmail.com>
    > Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
    > Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
    > ---
    > include/linux/kallsyms.h | 2 +-
    > kernel/livepatch/core.c | 4 ++--
    > scripts/kallsyms.c | 4 ++--
    > tools/include/linux/kallsyms.h | 2 +-
    > tools/lib/perf/include/perf/event.h | 2 +-
    > tools/lib/symbol/kallsyms.h | 2 +-
    > 6 files changed, 8 insertions(+), 8 deletions(-)

    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    \
     
     \ /
      Last update: 2022-09-27 16:57    [W:4.088 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site