21 Jun 2012 21:43
[PATCH] fs: make dumpable=2 only write to a pipe
Kees Cook <keescook <at> chromium.org>
2012-06-21 19:43:19 GMT
2012-06-21 19:43:19 GMT
When the suid_dumpable sysctl is set to "2", and there is no core dump pipe defined in the core_pattern sysctl, a local user can cause core files to be written to root-writable directories, potentially with user-controlled content. This means an admin can unknowningly reintroduce a variation of CVE-2006-2451 (see abf75a5033d4da7b8a7e92321d74021d1fcfb502). $ cat /proc/sys/fs/suid_dumpable 2 $ cat /proc/sys/kernel/core_pattern core $ ulimit -c unlimited $ cd / $ ls -l core ls: cannot access core: No such file or directory $ touch core touch: cannot touch `core': Permission denied $ OHAI="evil-string-here" ping localhost >/dev/null 2>&1 & $ pid=$1 $ sleep 1 $ kill -SEGV $pid $ ls -l core -(Continue reading)rw------- 1 root kees 458752 Jun 21 11:35 core $ sudo strings core | grep evil OHAI=evil-string-here While cron has been fixed to abort reading a file when there is any parse error, there are still other sensitive directories that will read any file present and skip unparsable lines.

RSS Feed