proc.5, core.5: clarify suid_dumpable vs core_pattern
PATCH 1/1 proc.5, core.5: clarify suid_dumpable vs core_pattern
In 3.6, additional requirements were placed on core_pattern when suid_dumpable is set to 2. Document this and include commit references.
--- man5/core.5 | 8 ++++++++ man5/proc.5 | 7 +++++++ 2 files changed, 15 insertions(+)
man5/core.5 +8 -0
@@ -176,6 +176,14 @@ file contains the value 0, then a core dump file is simply named If this file contains a nonzero value, then the core dump file includes the process ID in a name of the form .IR core.PID . + +Since version 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709 +if +.I /proc/sys/fs/suid_dumpable +is set to 2 ("suidsafe"), the pattern must be either a fully qualified path +(starting with a leading \(aq/\(aq character) or a pipe, as defined below. + .SS Piping core dumps to a program Since kernel 2.6.19, Linux supports an alternate syntax for the .I /proc/sys/kernel/core_pattern
man5/proc.5 +7 -0
@@ -2481,6 +2481,13 @@ For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment. +Additionally, since Linux 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709 +.I /proc/sys/kernel/core_pattern +must either be a fully-qualified path, or a pipe command, as detailed in +.BR core (5). +Warnings will be emitted to the kernel syslog about disallowed combinations. +.\" 54b501992dd2a839e94e76aa392c392b55080ce8 .TP .I /proc/sys/fs/super-max This file
Signature · 10 lines
1.7.9.5 -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 20130111211255.GA14713-0X9Bc/[email protected]
Hi Kees,
Thanks for the patch. A couple of questions below.
Quoted 15 lines · Kees Cook
In 3.6, additional requirements were placed on
core_patternwhensuid_dumpableis set to 2. Document this and include commit references.Signed-off-by Kees Cook <[email protected]>--- man5/core.5 | 8 ++++++++ man5/proc.5 | 7 +++++++ 2 files changed, 15 insertions(+)man5/core.5 +0
-0@@ -176,6 +176,14 @@ file contains the value 0, then a core dump file is simply named If this file contains a nonzero value, then the core dump file includes
man5/core.5 file contains the value 0, then a core dump file is simply named · line 186
Quoted 10 lines
man5/core.5 +8
-0the process ID in a name of the form .IR core.PID . + +Since version 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709 +if +.I /proc/sys/fs/suid_dumpable +is set to 2 ("suidsafe"), the pattern must be either a fully qualified path +(starting with a leading \(aq/\(aq character) or a pipe, as defined below. +
By fully qualified path (which is somewhat non-standard terminology, at least in man-pages), I assume you mean "absolute pathname".
Quoted 8 lines
man5/core.5 +0
-0.SS Piping core dumps to a program Since kernel 2.6.19, Linux supports an alternate syntax for the .I /proc/sys/kernel/core_patternman5/proc.5 +0
-0
man5/proc.5 For security reasons core dumps in this mode will not overwrite one · line 2489
Quoted 9 lines
man5/proc.5 +6
-0@@ -2481,6 +2481,13 @@ For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment. +Additionally, since Linux 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709 +.I /proc/sys/kernel/core_pattern +must either be a fully-qualified path, or a pipe command, as detailed in +.BR core (5). +Warnings will be emitted to the kernel syslog about disallowed combinations.
What does "disallowed combinations" mean? Other than an absolute pathname or a pipe command? And other than the warning to the kernel log, how are the disallowed combinations treated? Are they ignored?
Thanks,
Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAKgNAkjZvZmSgJUVkrLXuXiKDLccnkqGvrrbN4KR+fhkN4P8+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 25 lines · Michael Kerrisk (man-pages)
Hi Kees,
Thanks for the patch. A couple of questions below.
Quoted 20 lines · Kees Cook
In 3.6, additional requirements were placed on
core_patternwhensuid_dumpableis set to 2. Document this and include commit references.Signed-off-by Kees Cook <[email protected]>--- man5/core.5 | 8 ++++++++ man5/proc.5 | 7 +++++++ 2 files changed, 15 insertions(+)man5/core.5 +3
-0@@ -176,6 +176,14 @@ file contains the value 0, then a core dump file is simply named If this file contains a nonzero value, then the core dump file includes the process ID in a name of the form .IR core.PID . + +Since version 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709
Quoted 8 lines
man5/core.5 file contains the value 0, then a core dump file is simply named · line 186
Quoted 5 lines
man5/core.5 +5
-0+if +.I /proc/sys/fs/suid_dumpable +is set to 2 ("suidsafe"), the pattern must be either a fully qualified path +(starting with a leading \(aq/\(aq character) or a pipe, as defined below. +By fully qualified path (which is somewhat non-standard terminology, at least in man-pages), I assume you mean "absolute pathname".
Oh! Yes, totally right. My head is stuck on "fully qualified domain name", I think. :) Absolute path is what I meant here.
Quoted 13 lines
Quoted 13 lines
man5/core.5 +0
-0.SS Piping core dumps to a program Since kernel 2.6.19, Linux supports an alternate syntax for the .I /proc/sys/kernel/core_patternman5/proc.5 +2
-0@@ -2481,6 +2481,13 @@ For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment. +Additionally, since Linux 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709
Quoted 8 lines
man5/proc.5 For security reasons core dumps in this mode will not overwrite one · line 2489
Quoted 4 lines
man5/proc.5 +4
-0+.I /proc/sys/kernel/core_pattern +must either be a fully-qualified path, or a pipe command, as detailed in +.BR core (5). +Warnings will be emitted to the kernel syslog about disallowed combinations.What does "disallowed combinations" mean? Other than an absolute pathname or a pipe command? And other than the warning to the kernel log, how are the disallowed combinations treated? Are they ignored?
Yeah, by disallowed I mean a core_pattern that starts with neither / nor | and suid_dumpable is set to 2. When conditions change to a disallowed state, the kernel warns in dmesg. If a core dump happens under this condition, the kernel warns again about the condition and does not dump core.
-Kees
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAGXu5jLVn0DfaDpjfJeiMCoFJt8ZCUN9AjONAbEGcVYtEAiXZw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 22 lines
Quoted 13 lines
Quoted 13 lines
.SS Piping core dumps to a program
Since kernel 2.6.19, Linux supports an alternate syntax for the .I/proc/sys/kernel/core_patternman5/proc.5 +2
-0@@ -2481,6 +2481,13 @@ For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment. +Additionally, since Linux 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709Quoted 8 lines
man5/proc.5 For security reasons core dumps in this mode will not overwrite one · line 2489
Quoted 4 lines
man5/proc.5 +4
-0+.I /proc/sys/kernel/core_pattern +must either be a fully-qualified path, or a pipe command, as detailed in +.BR core (5). +Warnings will be emitted to the kernel syslog about disallowed combinations.What does "disallowed combinations" mean? Other than an absolute pathname or a pipe command? And other than the warning to the kernel log, how are the disallowed combinations treated? Are they ignored?
Quoted 5 lines
Yeah, by disallowed I mean a
core_patternthat starts with neither / nor | andsuid_dumpableis set to 2. When conditions change to a disallowed state, the kernel warns in dmesg. If a core dump happens under this condition, the kernel warns again about the condition and does not dump core.
So, does the following text look okay?
Additionally, since Linux 3.6, /proc/sys/ker‐ nel/core_pattern must either be an absolute path‐ name or a pipe command, as detailed in core(5). Warnings will be written to the kernel log if core_pattern does not follow these rules, and no core dump will be produced.
Cheers,
Michael
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAKgNAkjzcd0PFzd_kQfXt3cOkyR+Wo8jXTndBn3SAUU40xUFrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 28 lines · Michael Kerrisk (man-pages)
Quoted 22 lines
Quoted 13 lines
Quoted 13 lines
.SS Piping core dumps to a program
Since kernel 2.6.19, Linux supports an alternate syntax for the .I/proc/sys/kernel/core_patternman5/proc.5 +2
-0@@ -2481,6 +2481,13 @@ For security reasons core dumps in this mode will not overwrite one another or other files. This mode is appropriate when administrators are attempting to debug problems in a normal environment. +Additionally, since Linux 3.6, +.\" 9520628e8ceb69fa9a4aee6b57f22675d9e1b709Quoted 8 lines
man5/proc.5 For security reasons core dumps in this mode will not overwrite one · line 2489
Quoted 4 lines
man5/proc.5 +4
-0+.I /proc/sys/kernel/core_pattern +must either be a fully-qualified path, or a pipe command, as detailed in +.BR core (5). +Warnings will be emitted to the kernel syslog about disallowed combinations.What does "disallowed combinations" mean? Other than an absolute pathname or a pipe command? And other than the warning to the kernel log, how are the disallowed combinations treated? Are they ignored?
Quoted 5 lines
Yeah, by disallowed I mean a
core_patternthat starts with neither / nor | andsuid_dumpableis set to 2. When conditions change to a disallowed state, the kernel warns in dmesg. If a core dump happens under this condition, the kernel warns again about the condition and does not dump core.
Quoted 8 lines
So, does the following text look okay?
Additionally, since Linux 3.6, /proc/sys/ker‐ nel/core_pattern must either be an absolute path‐ name or a pipe command, as detailed in core(5). Warnings will be written to the kernel log if
core_patterndoes not follow these rules, and no core dump will be produced.
Yeah, that looks great. Thanks!
-Kees
--
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html