Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kbuild: fix a buffer overflow in modpost

When passing an file name > 1k the stack could be overflowed.
Not really a security issue, but still better plugged.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

authored by

Andi Kleen and committed by
Sam Ravnborg
666ab414 58b7a68d

+2 -1
+2 -1
scripts/mod/modpost.c
··· 1656 1656 { 1657 1657 struct module *mod; 1658 1658 struct buffer buf = { }; 1659 - char fname[SZ]; 1660 1659 char *kernel_read = NULL, *module_read = NULL; 1661 1660 char *dump_write = NULL; 1662 1661 int opt; ··· 1708 1709 err = 0; 1709 1710 1710 1711 for (mod = modules; mod; mod = mod->next) { 1712 + char fname[strlen(mod->name) + 10]; 1713 + 1711 1714 if (mod->skip) 1712 1715 continue; 1713 1716