Files
linux/arch/um/drivers
Jann Horn 378c6520e7 fs/coredump: prevent fsuid=0 dumps into user-controlled directories
This commit fixes the following security hole affecting systems where
all of the following conditions are fulfilled:

 - The fs.suid_dumpable sysctl is set to 2.
 - The kernel.core_pattern sysctl's value starts with "/". (Systems
   where kernel.core_pattern starts with "|/" are not affected.)
 - Unprivileged user namespace creation is permitted. (This is
   true on Linux >=3.8, but some distributions disallow it by
   default using a distro patch.)

Under these conditions, if a program executes under secure exec rules,
causing it to run with the SUID_DUMP_ROOT flag, then unshares its user
namespace, changes its root directory and crashes, the coredump will be
written using fsuid=0 and a path derived from kernel.core_pattern - but
this path is interpreted relative to the root directory of the process,
allowing the attacker to control where a coredump will be written with
root privileges.

To fix the security issue, always interpret core_pattern for dumps that
are written under SUID_DUMP_ROOT relative to the root directory of init.

Signed-off-by: Jann Horn <[email protected]>
Acked-by: Kees Cook <[email protected]>
Cc: Al Viro <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2016-03-22 15:36:02 -07:00
..
2013-03-21 16:07:34 -07:00
2013-03-11 10:08:04 +01:00
2011-05-25 08:39:41 -07:00
2015-05-31 22:05:32 +02:00
2015-12-08 22:26:00 +01:00
2009-04-01 08:59:17 -07:00
…
…
2013-03-11 10:08:03 +01:00
2009-04-01 08:59:17 -07:00
2009-04-01 08:59:17 -07:00
2013-09-07 10:56:58 +02:00
2013-09-07 10:56:58 +02:00
…
2009-04-01 08:59:17 -07:00