Skip to contentSkip to conversation

Kbuild: Handle too long symbols in kallsyms.c

PATCH Applied [email protected] 3 participants 4 messages Jan 17, 2019 – Jan 28, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Kbuild: Handle too long symbols in kallsyms.c

From: Eugene Loh <[email protected]>

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

Fixes f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
---
 scripts/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kallsyms.c +2 -2
index 77cebad..f75e7bd 100644
@@ -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;
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Thu, 17 Jan 2019 at 23:46, <[email protected]> wrote:

From: Eugene Loh <[email protected]>

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

Fixes f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
Quoted 22 lines
---
 scripts/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kallsyms.c +2 -3
index 77cebad..f75e7bd 100644
@@ -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;
--

1.8.3.1

#2 lore raw

(+ masahiro)

Quoted 35 lines · Ard Biesheuvel
Quoted 8 lines · On Thu, 17 Jan 2019 at 23:46, <[email protected]> wrote:

From: Eugene Loh <[email protected]>

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

Fixes f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
Quoted 22 lines
---
 scripts/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kallsyms.c +2 -3
index 77cebad..f75e7bd 100644
@@ -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;
--

1.8.3.1

#3 lore raw
Quoted 15 lines · Ard Biesheuvel

(+ masahiro)

Quoted 11 lines · Ard Biesheuvel
Quoted 8 lines · On Thu, 17 Jan 2019 at 23:46, <[email protected]> wrote:

From: Eugene Loh <[email protected]>

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

Fixes f3462aa952cf ("Kbuild: Handle longer symbols in kallsyms.c")
Quoted 8 lines
Quoted 8 lines

scripts/kallsyms.c

Quoted 6 lines
---
 scripts/kallsyms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kallsyms.c +0 -0
index 77cebad..f75e7

Applied to linux-kbuid/fixes.
Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada