Commit 108ceeb0 authored by Jovi Zhang's avatar Jovi Zhang Committed by Linus Torvalds

coredump: fix wrong comments on core limits of pipe coredump case

In commit 898b374a ("exec: replace call_usermodehelper_pipe with use
of umh init function and resolve limit"), the core limits recursive
check value was changed from 0 to 1, but the corresponding comments were
not updated.
Signed-off-by: default avatarJovi Zhang <bookjovi@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0f20784d
...@@ -2174,15 +2174,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs) ...@@ -2174,15 +2174,16 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
} }
if (cprm.limit == 1) { if (cprm.limit == 1) {
/* /* See umh_pipe_setup() which sets RLIMIT_CORE = 1.
*
* Normally core limits are irrelevant to pipes, since * Normally core limits are irrelevant to pipes, since
* we're not writing to the file system, but we use * we're not writing to the file system, but we use
* cprm.limit of 1 here as a speacial value. Any * cprm.limit of 1 here as a speacial value, this is a
* non-1 limit gets set to RLIM_INFINITY below, but * consistent way to catch recursive crashes.
* a limit of 0 skips the dump. This is a consistent * We can still crash if the core_pattern binary sets
* way to catch recursive crashes. We can still crash * RLIM_CORE = !1, but it runs as root, and can do
* if the core_pattern binary sets RLIM_CORE = !1 * lots of stupid things.
* but it runs as root, and can do lots of stupid things *
* Note that we use task_tgid_vnr here to grab the pid * Note that we use task_tgid_vnr here to grab the pid
* of the process group leader. That way we get the * of the process group leader. That way we get the
* right pid if a thread in a multi-threaded * right pid if a thread in a multi-threaded
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment