On Tue, Nov 05, 2024 at 10:19:11AM -0800, Kees Cook wrote: > Attempting to free an ERR_PTR will not work. ;) > > process 'syz-executor210' launched '/dev/fd/3' with NULL argv: empty > string added > kernel BUG at arch/x86/mm/physaddr.c:23! > > Set bprm->argv0 to NULL if it fails to get a string from userspace so > that bprm_free() will not try to free an invalid pointer when cleaning up. > > Reported-by: [email protected] > Closes: https://lore.kernel.org/all/[email protected] > Fixes: 7bdc6fc85c9a ("exec: fix up /proc/pid/comm in the > execveat(AT_EMPTY_PATH) case") > Signed-off-by: Kees Cook <[email protected]> > ---
Reviewed-by: Christian Brauner <[email protected]>
