]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kernel/kmod.c: check for NULL in call_usermodehelper_exec()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 30 Sep 2013 20:45:08 +0000 (13:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Oct 2013 01:14:30 +0000 (18:14 -0700)
commit29416e26236a2e6b9cfe67260835300dc07b2d26
tree7a005fd0eefb690fd79647ecfa06fc238991a5b6
parent3e446da23ffc230fbd3d9cf52f2a2d94ba8e941c
kernel/kmod.c: check for NULL in call_usermodehelper_exec()

commit 4c1c7be95c345cf2ad537a0c48e9aeadc7304527 upstream.

If /proc/sys/kernel/core_pattern contains only "|", a NULL pointer
dereference happens upon core dump because argv_split("") returns
argv[0] == NULL.

This bug was once fixed by commit 264b83c07a84 ("usermodehelper: check
subprocess_info->path != NULL") but was by error reintroduced by commit
7f57cfa4e2aa ("usermodehelper: kill the sub_info->path[0] check").

This bug seems to exist since 2.6.19 (the version which core dump to
pipe was added).  Depending on kernel version and config, some side
effect might happen immediately after this oops (e.g.  kernel panic with
2.6.32-358.18.1.el6).

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/kmod.c