Information
fs.suid_dumpable governs whether a privileged process (with the setuid bit) can generate a core dump, regardless of other configurations.
fs.suid_dumpable values:
- 0 (default) - Any process that has changed privilege levels (like SUID programs) or is execute-only will not dump core.
- 1 (debug) - All processes dump core if possible. The core dump is owned by the current user and security is not applied. This is primarily intended for system debugging.
- 2 (suidsafe) - Any binary that normally wouldn't be dumped is dumped, but only if the core_pattern is set to a pipe handler or a fully qualified path. This mode is suitable for administrators debugging in a production environment.
More information about the kernel parameter configuration files, their location, and load preference is available in the section overview.
core dumps may contain sensitive in-memory data like password hashes or keys. An attacker could potentially exploit this to gain access to such data.
Solution
- Run the following command to comment out fs.suid_dumpable lines returned by the audit procedure that are not fs.suid_dumpable = 0 :
# sed -ri '^\s*fs.suid_dumpable\s*=\s*1/s/^/#/g' "path/to/file/in/audit/filename"
Example:
# sed -ri '/^\s*fs.suid_dumpable\s*=\s*1/s/^/#/g' /etc/sysctl.d/99-sysctl.conf
- Create or edit a file in the /etc/sysctl.d/ directory ending in .conf and edit or add the following line:
fs.suid_dumpable = 0
Example:
# [ ! -d "/etc/sysctl.d/" ] && mkdir -p /etc/sysctl.d/
# printf '%s\n' "" "fs.suid_dumpable = 0" >> /etc/sysctl.d/60-fs_sysctl.conf
- Run the following command to load all sysctl configuration filles:
# sysctl --system
Impact:
Any process that has changed privilege levels (like SUID programs) or is execute-only will not dump core.