lkml.org 
[lkml]   [2019]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL 4.20 02/60] kallsyms: Handle too long symbols in kallsyms.c
    Date
    From: Eugene Loh <eugene.loh@oracle.com>

    [ Upstream commit 6db2983cd8064808141ccefd75218f5b4345ffae ]

    When checking for symbols with excessively long names,
    account for null terminating character.

    Fixes: f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
    Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
    Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
    Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    scripts/kallsyms.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
    index 109a1af7e444..f9339da8605e 100644
    --- a/scripts/kallsyms.c
    +++ b/scripts/kallsyms.c
    @@ -118,8 +118,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
    fprintf(stderr, "Read error or end of file.\n");
    return -1;
    }
    - if (strlen(sym) > KSYM_NAME_LEN) {
    - fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
    + if (strlen(sym) >= KSYM_NAME_LEN) {
    + fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
    "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
    sym, strlen(sym), KSYM_NAME_LEN);
    return -1;
    --
    2.19.1
    \
     
     \ /
      Last update: 2019-03-13 20:35    [W:3.754 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site