Skip to content

Commit

Permalink
kbuild: fix a buffer overflow in modpost
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and Sam Ravnborg committed Jan 28, 2008
1 parent 58b7a68 commit 666ab41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,6 @@ int main(int argc, char **argv)
{
struct module *mod;
struct buffer buf = { };
char fname[SZ];
char *kernel_read = NULL, *module_read = NULL;
char *dump_write = NULL;
int opt;
Expand Down Expand Up @@ -1709,6 +1708,8 @@ int main(int argc, char **argv)
err = 0;

for (mod = modules; mod; mod = mod->next) {
char fname[strlen(mod->name) + 10];

if (mod->skip)
continue;

Expand Down

0 comments on commit 666ab41

Please sign in to comment.