X Tutup
Skip to content

Commit 6635f57

Browse files
keszybzpoettering
authored andcommitted
sysctl: enable coredump for suid binaries
Right now the kernel will not dump anything that went through setuid or setgid. But it is routine for daemons to do that, and it makes things hard to debug. systemd-coredump saves the coredump readable by the users the process was running as. This should be enough to avoid information leakage. So let's also tell the kernel to do the coredump. For https://bugzilla.redhat.com/show_bug.cgi?id=1790972. Both patterns are stored in the same file, so they are enabled or disabled together. (Though suid_dumpable=2 is supposed to be safe even when writing to plain files.)
1 parent f9d29f6 commit 6635f57

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
systemd System and Service Manager
22

3+
CHANGES WITH 246 in spe:
4+
* The fs.suid_dumpable sysctl is set to 2 / "suidsafe". This allows
5+
systemd-coredump to save core files for suid processes. When saving
6+
the core file, systemd-coredump will use the effective uid and gid of
7+
the process that faulted.
8+
39
CHANGES WITH 245:
410

511
* A new tool "systemd-repart" has been added, that operates as an

sysctl.d/50-coredump.conf.in

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,23 @@
55
# the Free Software Foundation; either version 2.1 of the License, or
66
# (at your option) any later version.
77

8-
# See sysctl.d(5) for the description of the files in this directory,
9-
# and systemd-coredump(8) and core(5) for the explanation of the
10-
# setting below.
8+
# See sysctl.d(5) for the description of the files in this directory.
119

10+
# Pipe the core file to systemd-coredump. The systemd-coredump process spawned
11+
# by the kernel will start a second copy of itself as the
12+
# systemd-coredump@.service, which will do the actual processing and storing of
13+
# the core dump.
14+
#
15+
# See systemd-coredump(8) and core(5).
1216
kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %P %u %g %s %t %c %h
17+
18+
# Also dump processes executing a set-user-ID/set-group-ID program that is
19+
# owned by a user/group other than the real user/group ID of the process, or
20+
# a program that has file capabilities. ("2" is called "suidsafe" in core(5)).
21+
#
22+
# systemd-coredump will store the core file owned by the effective uid and gid
23+
# of the running process (and not the filesystem-user-ID which the kernel uses
24+
# when saving a core dump).
25+
#
26+
# See proc(5), setuid(2), capabilities(7).
27+
fs.suid_dumpable=2

0 commit comments

Comments
 (0)
X Tutup