diff options
author | Andi Kleen <ak@suse.de> | 2007-11-21 21:43:10 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-01-28 17:14:36 -0500 |
commit | 666ab414fe14e8bbbe86a110437346128e1ec869 (patch) | |
tree | 397dc03cba3aca4b0a1272fa927db89a7f3560e6 | |
parent | 58b7a68de37face98afe7c705391145795a982b5 (diff) |
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>
-rw-r--r-- | scripts/mod/modpost.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 404ee0d0aac6..4d1c59063b27 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1656,7 +1656,6 @@ int main(int argc, char **argv) | |||
1656 | { | 1656 | { |
1657 | struct module *mod; | 1657 | struct module *mod; |
1658 | struct buffer buf = { }; | 1658 | struct buffer buf = { }; |
1659 | char fname[SZ]; | ||
1660 | char *kernel_read = NULL, *module_read = NULL; | 1659 | char *kernel_read = NULL, *module_read = NULL; |
1661 | char *dump_write = NULL; | 1660 | char *dump_write = NULL; |
1662 | int opt; | 1661 | int opt; |
@@ -1709,6 +1708,8 @@ int main(int argc, char **argv) | |||
1709 | err = 0; | 1708 | err = 0; |
1710 | 1709 | ||
1711 | for (mod = modules; mod; mod = mod->next) { | 1710 | for (mod = modules; mod; mod = mod->next) { |
1711 | char fname[strlen(mod->name) + 10]; | ||
1712 | |||
1712 | if (mod->skip) | 1713 | if (mod->skip) |
1713 | continue; | 1714 | continue; |
1714 | 1715 | ||