mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
kallsyms: make KSYM_NAME_LEN include space for trailing '\0'
KSYM_NAME_LEN is peculiar in that it does not include the space for the trailing '\0', forcing all users to use KSYM_NAME_LEN + 1 when allocating buffer. This is nonsense and error-prone. Moreover, when the caller forgets that it's very likely to subtly bite back by corrupting the stack because the last position of the buffer is always cleared to zero. This patch increments KSYM_NAME_LEN by one and updates code accordingly. * off-by-one bug in asm-powerpc/kprobes.h::kprobe_lookup_name() macro is fixed. * Where MODULE_NAME_LEN and KSYM_NAME_LEN were used together, MODULE_NAME_LEN was treated as if it didn't include space for the trailing '\0'. Fix it. Signed-off-by: Tejun Heo <[email protected]> Acked-by: Paulo Marques <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b45d527974
commit
9281acea6a
11 changed files with 27 additions and 27 deletions
|
|
@ -4344,7 +4344,7 @@ static void show_symbol(struct seq_file *m, unsigned long address)
|
|||
{
|
||||
#ifdef CONFIG_KALLSYMS
|
||||
unsigned long offset, size;
|
||||
char modname[MODULE_NAME_LEN + 1], name[KSYM_NAME_LEN + 1];
|
||||
char modname[MODULE_NAME_LEN], name[KSYM_NAME_LEN];
|
||||
|
||||
if (lookup_symbol_attrs(address, &size, &offset, modname, name) == 0) {
|
||||
seq_printf(m, "%s+%#lx/%#lx", name, offset, size);
|
||||
|
|
|
|||
Loading…
Reference in a new issue