]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs: Don't dump core if the corefile would become world-readable.
authorJann Horn <jann@thejh.net>
Wed, 9 Sep 2015 22:38:30 +0000 (15:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:26:12 +0000 (19:26 +0200)
commit2be9c8262419a2db45e7461b1eb26ead770a4438
tree7b0d381ea836e93178b84a14db4872a8b8ebadea
parent244d3c13db7a94ceecfb591fba716a525d53aa38
fs: Don't dump core if the corefile would become world-readable.

commit 40f705a736eac10e7dca7ab5dd5ed675a6df031d upstream.

On a filesystem like vfat, all files are created with the same owner
and mode independent of who created the file. When a vfat filesystem
is mounted with root as owner of all files and read access for everyone,
root's processes left world-readable coredumps on it (but other
users' processes only left empty corefiles when given write access
because of the uid mismatch).

Given that the old behavior was inconsistent and insecure, I don't see
a problem with changing it. Now, all processes refuse to dump core unless
the resulting corefile will only be readable by their owner.

Signed-off-by: Jann Horn <jann@thejh.net>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/coredump.c