]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Fix up non-directory creation in SGID directories
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jul 2018 00:10:19 +0000 (17:10 -0700)
committerBrian Maly <brian.maly@oracle.com>
Tue, 21 Aug 2018 17:36:51 +0000 (13:36 -0400)
commit84824414fbcdc308905d4e18225d6d4d42e188e2
treed7437d190ba200967e39e9ffca9476aa37a92355
parent9bcb0bc176e372b0ee233a08d751f7c8d9ea7e86
Fix up non-directory creation in SGID directories

sgid directories have special semantics, making newly created files in
the directory belong to the group of the directory, and newly created
subdirectories will also become sgid.  This is historically used for
group-shared directories.

But group directories writable by non-group members should not imply
that such non-group members can magically join the group, so make sure
to clear the sgid bit on non-directories for non-members (but remember
that sgid without group execute means "mandatory locking", just to
confuse things even more).

Reported-by: Jann Horn <jannh@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 0fa3ecd87848c9c93c2c828ef4c3a8ca36ce46c7)

Orabug: 28459477
CVE: CVE-2018-13405

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
fs/inode.c