Commit cacf3c0d authored by Eugene Loh's avatar Eugene Loh Committed by Greg Kroah-Hartman

kallsyms: Handle too long symbols in kallsyms.c

[ Upstream commit 6db2983c ]

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

Fixes: f3462aa9 ("Kbuild: Handle longer symbols in kallsyms.c")
Signed-off-by: default avatarEugene Loh <eugene.loh@oracle.com>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 980f44f8
......@@ -120,8 +120,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment