]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Fix up non-directory creation in SGID directories
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 16 Jul 2018 18:50:35 +0000 (18:50 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:30:17 +0000 (12:30 +0200)
commitebd8ccf840103e2d3e32b10520fd510a68ca825c
tree68a855734359cac8adf04a2e8d712ebe7484b259
parent80ffa8698a6881860d42899789bcd7bd4efa6fe0
Fix up non-directory creation in SGID directories

BugLink: https://launchpad.net/bugs/1779923
CVE-2018-13405

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)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/inode.c