]> git.baikalelectronics.ru Git - kernel.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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Sep 2013 21:31:02 +0000 (14:31 -0700)
commit51a266470296e2ef81cde4937bf6bd4c0176f44b
treed60639057e1d30c853330c513754d8e43f7306cb
parent8dd9c8f112b26972a48d1a3f18ee632477d82bdd
kernel/kmod.c: check for NULL in call_usermodehelper_exec()

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 5eb95658cefb ("usermodehelper: check
subprocess_info->path != NULL") but was by error reintroduced by commit
d94881fd1093 ("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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/kmod.c