Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 666ab414 authored by Andi Kleen's avatar Andi Kleen Committed by Sam Ravnborg
Browse files

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: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 58b7a68d
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1656,7 +1656,6 @@ int main(int argc, char **argv)
{
{
	struct module *mod;
	struct module *mod;
	struct buffer buf = { };
	struct buffer buf = { };
	char fname[SZ];
	char *kernel_read = NULL, *module_read = NULL;
	char *kernel_read = NULL, *module_read = NULL;
	char *dump_write = NULL;
	char *dump_write = NULL;
	int opt;
	int opt;
@@ -1709,6 +1708,8 @@ int main(int argc, char **argv)
	err = 0;
	err = 0;


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

		if (mod->skip)
		if (mod->skip)
			continue;
			continue;