Skip to content

Commit 719dfd5

Browse files
maninder42mpe
authored andcommitted
powerpc/xmon: Use KSYM_NAME_LEN in array size
kallsyms_lookup() which in turn calls kallsyms_lookup_buildid() writes to index "KSYM_NAME_LEN - 1". Thus the array passed as namebuf to kallsyms_lookup() should be KSYM_NAME_LEN in size. In xmon.c the array was defined to be "128" bytes directly, without using KSYM_NAME_LEN. Commit b8a94bf ("kallsyms: increase maximum kernel symbol length to 512") changed the value to 512, but missed updating the xmon code. Fixes: b8a94bf ("kallsyms: increase maximum kernel symbol length to 512") Cc: [email protected] # v6.1+ Co-developed-by: Onkarnath <[email protected]> Signed-off-by: Onkarnath <[email protected]> Signed-off-by: Maninder Singh <[email protected]> [mpe: Tweak change log wording and fix commit reference] Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent 9d2ccf0 commit 719dfd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/xmon/xmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ static unsigned long ndump = 64;
8888
static unsigned long nidump = 16;
8989
static unsigned long ncsum = 4096;
9090
static int termch;
91-
static char tmpstr[128];
91+
static char tmpstr[KSYM_NAME_LEN];
9292
static int tracing_enabled;
9393

9494
static long bus_error_jmp[JMP_BUF_LEN];

0 commit comments

Comments
 (0)