]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.31/kallsyms-handle-too-long-symbols-in-kallsyms.c.patch
Linux 4.19.31
[thirdparty/kernel/stable-queue.git] / releases / 4.19.31 / kallsyms-handle-too-long-symbols-in-kallsyms.c.patch
CommitLineData
36e3f504
SL
1From 9cf4ceebcf06a336d33666e6120b11afe2613eb3 Mon Sep 17 00:00:00 2001
2From: Eugene Loh <eugene.loh@oracle.com>
3Date: Thu, 17 Jan 2019 14:46:00 -0800
4Subject: kallsyms: Handle too long symbols in kallsyms.c
5
6[ Upstream commit 6db2983cd8064808141ccefd75218f5b4345ffae ]
7
8When checking for symbols with excessively long names,
9account for null terminating character.
10
11Fixes: f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
12Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
13Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
14Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
15Signed-off-by: Sasha Levin <sashal@kernel.org>
16---
17 scripts/kallsyms.c | 4 ++--
18 1 file changed, 2 insertions(+), 2 deletions(-)
19
20diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
21index a9186a98a37d..0c9c54b57515 100644
22--- a/scripts/kallsyms.c
23+++ b/scripts/kallsyms.c
24@@ -120,8 +120,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)
25 fprintf(stderr, "Read error or end of file.\n");
26 return -1;
27 }
28- if (strlen(sym) > KSYM_NAME_LEN) {
29- fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
30+ if (strlen(sym) >= KSYM_NAME_LEN) {
31+ fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
32 "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
33 sym, strlen(sym), KSYM_NAME_LEN);
34 return -1;
35--
362.19.1
37