Bug in binfmt_misc?
Subsystems (2)
PATCH 1/1 Bug in binfmt_misc?
As far as I can tell, this should never cause a problem, but someone pointed this out:
fs/binfmt_misc.c +2 -0
@@ -128,6 +128,8 @@ static int load_misc_binary(struct linux retval =copy_strings_kernel (1 , &iname_addr, bprm);if (retval <0 ) goto _ret; bprm->argc++; +/* BUG: iname is a local variable and given to an outside struct. +* this will cause problems when function scope ends */ bprm->filename = iname;/* for binfmt_script */ file =open_exec (iname);
Now, if this isn't a problem, the following should at least catch any future misuses:
fs/binfmt_misc.c +1 -0
@@ -139,6 +139,7 @@ static int load_misc_binary(struct linux retval =prepare_binprm (bprm);if (retval >=0 ) retval =search_binary_handler (bprm, regs); + bprm->filename =NULL ; _ret:return retval; }
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.