From: Alejandro Colomar Date: Sun, 26 May 2024 16:58:21 +0000 (+0200) Subject: PR_SET_DUMPABLE.2const: Tweak after split X-Git-Tag: man-pages-6.9~19^2~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd15732c695dd7ef66612ce33c846dfd52ef4e02;p=thirdparty%2Fman-pages.git PR_SET_DUMPABLE.2const: Tweak after split Signed-off-by: Alejandro Colomar --- diff --git a/man/man2const/PR_SET_DUMPABLE.2const b/man/man2const/PR_SET_DUMPABLE.2const index 26990a581..511f2ea7a 100644 --- a/man/man2const/PR_SET_DUMPABLE.2const +++ b/man/man2const/PR_SET_DUMPABLE.2const @@ -1,10 +1,8 @@ .\" Copyright 2002, 2006, 2008, 2012, 2013, 2015, Michael Kerrisk +.\" Copyright 2024, Alejandro Colomar .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" -.\" Modified 27 Jun 02, Michael Kerrisk -.\" Added PR_SET_DUMPABLE -.\" .TH PR_SET_DUMPABLE 2const (date) "Linux man-pages (unreleased)" .SH NAME PR_SET_DUMPABLE @@ -17,46 +15,28 @@ Standard C library .nf .B #include .P -.BI "int prctl(int " op ", ..." -.BI " \fR/*\fP unsigned long " arg2 ", unsigned long " arg3 , -.BI " unsigned long " arg4 ", unsigned long " arg5 " \fR*/\fP );" +.BI "int prctl(PR_SET_DUMPABLE, long " dumpable ", 0L, 0L, 0L);" .fi .SH DESCRIPTION -.TP -.BR PR_SET_DUMPABLE " (since Linux 2.3.20)" Set the state of the "dumpable" attribute, which determines whether core dumps are produced for the calling process upon delivery of a signal whose default behavior is to produce a core dump. -.IP -Up to and including Linux 2.6.12, -.I arg2 -must be either 0 +.P +.I dumpable +must be either +.B 0L .RB ( SUID_DUMP_DISABLE , -process is not dumpable) or 1 +process is not dumpable) or +.B 1L .RB ( SUID_DUMP_USER , process is dumpable). -Between Linux 2.6.13 and Linux 2.6.17, -.\" commit abf75a5033d4da7b8a7e92321d74021d1fcfb502 -the value 2 was also permitted, -which caused any binary which normally would not be dumped -to be dumped readable by root only; -for security reasons, this feature has been removed. -.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2 -.\" Subject: Fix prctl privilege escalation (CVE-2006-2451) -.\" From: Marcel Holtmann -.\" Date: 2006-07-12 11:12:00 -(See also the description of -.I /proc/sys/fs/\:suid_dumpable -in -.BR proc (5).) -.IP +.P Normally, the "dumpable" attribute is set to 1. However, it is reset to the current value contained in the file .I /proc/sys/fs/\:suid_dumpable (which by default has the value 0), in the following circumstances: .\" See kernel/cred.c::commit_creds() (Linux 3.18 sources) -.RS .IP \[bu] 3 The process's effective user or group ID is changed. .IP \[bu] @@ -76,20 +56,19 @@ a program that has file capabilities (see but only if the permitted capabilities gained exceed those already permitted for the process. .\" Also certain namespace operations; -.RE -.IP +.P Processes that are not dumpable can not be attached via .BR ptrace (2) .BR PTRACE_ATTACH ; see .BR ptrace (2) for further details. -.IP +.P If a process is not dumpable, the ownership of files in the process's .IR /proc/ pid directory is affected as described in -.BR proc (5). +.BR proc_pid (5). .SH RETURN VALUE On success, 0 is returned. @@ -99,17 +78,37 @@ is set to indicate the error. .SH ERRORS .TP .B EINVAL -.I op -is -.B PR_SET_DUMPABLE -and .I arg2 is neither .B SUID_DUMP_DISABLE nor .BR SUID_DUMP_USER . +.SH FILES +.TP +.I /proc/sys/fs/\:suid_dumpable +.TP +.IR /proc/ pid / .SH STANDARDS Linux. .SH HISTORY +Linux 2.3.20. +.P +Between Linux 2.6.13 and Linux 2.6.17, +.\" commit abf75a5033d4da7b8a7e92321d74021d1fcfb502 +the value +.B 2L +was also permitted, +which caused any binary which normally would not be dumped +to be dumped readable by root only; +for security reasons, this feature has been removed. +.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=115270289030630&w=2 +.\" Subject: Fix prctl privilege escalation (CVE-2006-2451) +.\" From: Marcel Holtmann +.\" Date: 2006-07-12 11:12:00 +(See also the description of +.I /proc/sys/fs/\:suid_dumpable +in +.BR proc_sys_fs (5).) .SH SEE ALSO -.BR prctl (2) +.BR prctl (2), +.BR PR_SET_DUMPABLE (2const)