[linux] 07/08: tmpfs: clear S_ISGID when setting posix ACLs (CVE-2017-5551)
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Tue Feb 21 03:08:33 UTC 2017
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch jessie-security
in repository linux.
commit 8fb318b04e47270da478c6b69be7e5dc7bc841fa
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Tue Feb 21 02:06:00 2017 +0000
tmpfs: clear S_ISGID when setting posix ACLs (CVE-2017-5551)
---
debian/changelog | 1 +
...pfs-clear-s_isgid-when-setting-posix-acls.patch | 41 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 43 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 5a04f9b..d7b76e7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,6 +16,7 @@ linux (3.16.39-1+deb8u1) UNRELEASED; urgency=medium
* [x86] KVM: Introduce segmented_write_std (CVE-2017-2584)
* selinux: fix off-by-one in setprocattr (CVE-2017-2618)
* USB: serial: kl5kusb105: fix line-state error handling (CVE-2017-5549)
+ * tmpfs: clear S_ISGID when setting posix ACLs (CVE-2017-5551)
-- Salvatore Bonaccorso <carnil at debian.org> Sat, 18 Feb 2017 18:26:58 +0100
diff --git a/debian/patches/bugfix/all/tmpfs-clear-s_isgid-when-setting-posix-acls.patch b/debian/patches/bugfix/all/tmpfs-clear-s_isgid-when-setting-posix-acls.patch
new file mode 100644
index 0000000..3631cae
--- /dev/null
+++ b/debian/patches/bugfix/all/tmpfs-clear-s_isgid-when-setting-posix-acls.patch
@@ -0,0 +1,41 @@
+From: Gu Zheng <guzheng1 at huawei.com>
+Date: Mon, 9 Jan 2017 09:34:48 +0800
+Subject: tmpfs: clear S_ISGID when setting posix ACLs
+Origin: https://git.kernel.org/linus/497de07d89c1410d76a15bec2bb41f24a2a89f31
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-5551
+
+This change was missed the tmpfs modification in In CVE-2016-7097
+commit 073931017b49 ("posix_acl: Clear SGID bit when setting
+file permissions")
+It can test by xfstest generic/375, which failed to clear
+setgid bit in the following test case on tmpfs:
+
+ touch $testfile
+ chown 100:100 $testfile
+ chmod 2755 $testfile
+ _runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx $testfile
+
+Signed-off-by: Gu Zheng <guzheng1 at huawei.com>
+Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
+---
+ fs/posix_acl.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/fs/posix_acl.c
++++ b/fs/posix_acl.c
+@@ -904,11 +904,10 @@ int simple_set_acl(struct inode *inode,
+ int error;
+
+ if (type == ACL_TYPE_ACCESS) {
+- error = posix_acl_equiv_mode(acl, &inode->i_mode);
+- if (error < 0)
+- return 0;
+- if (error == 0)
+- acl = NULL;
++ error = posix_acl_update_mode(inode,
++ &inode->i_mode, &acl);
++ if (error)
++ return error;
+ }
+
+ inode->i_ctime = CURRENT_TIME;
diff --git a/debian/patches/series b/debian/patches/series
index b3df324..b1cc4da 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -690,6 +690,7 @@ bugfix/x86/kvm-x86-fix-emulation-of-mov-ss-null-selector.patch
bugfix/x86/kvm-x86-introduce-segmented_write_std.patch
bugfix/all/selinux-fix-off-by-one-in-setprocattr.patch
bugfix/all/usb-serial-kl5kusb105-fix-line-state-error-handling.patch
+bugfix/all/tmpfs-clear-s_isgid-when-setting-posix-acls.patch
# Fix ABI changes
debian/of-fix-abi-changes.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list