mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] null-terminate over-long /proc/kallsyms symbols
Got a customer bug report (https://bugzilla.novell.com/190296) about kernel symbols longer than 127 characters which end up in a string buffer that is not NULL terminated, leading to garbage in /proc/kallsyms. Using strlcpy prevents this from happening, even though such symbols still won't come out right. A better fix would be to not use a fixed-size buffer, but it's probably not worth the trouble. (Modversion'ed symbols even have a length limit of 60.) [[email protected]: build fix] Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
329c6e4257
commit
098c5eea03
3 changed files with 10 additions and 15 deletions
|
|
@ -275,8 +275,8 @@ static void upcase_if_global(struct kallsym_iter *iter)
|
|||
static int get_ksymbol_mod(struct kallsym_iter *iter)
|
||||
{
|
||||
iter->owner = module_get_kallsym(iter->pos - kallsyms_num_syms,
|
||||
&iter->value,
|
||||
&iter->type, iter->name);
|
||||
&iter->value, &iter->type,
|
||||
iter->name, sizeof(iter->name));
|
||||
if (iter->owner == NULL)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue