Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usermodehelper: check subprocess_info->path != NULL

argv_split(empty_or_all_spaces) happily succeeds, it simply returns
argc == 0 and argv[0] == NULL. Change call_usermodehelper_exec() to
check sub_info->path != NULL to avoid the crash.

This is the minimal fix, todo:

- perhaps we should change argv_split() to return NULL or change the
callers.

- kill or justify ->path[0] check

- narrow the scope of helper_lock()

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-By: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Oleg Nesterov and committed by
Linus Torvalds
264b83c0 5c64e3a4

+5
+5
kernel/kmod.c
··· 569 569 int retval = 0; 570 570 571 571 helper_lock(); 572 + if (!sub_info->path) { 573 + retval = -EINVAL; 574 + goto out; 575 + } 576 + 572 577 if (sub_info->path[0] == '\0') 573 578 goto out; 574 579