<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/acl.c, branch linux-3.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.2.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-10-12T14:27:18Z</updated>
<entry>
<title>btrfs: preserve i_mode if __btrfs_set_acl() fails</title>
<updated>2017-10-12T14:27:18Z</updated>
<author>
<name>Ernesto A. Fernández</name>
</author>
<published>2017-08-02T06:18:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b6a9dc365dce00946080ccc482fc20a6b6c1476b'/>
<id>urn:sha1:b6a9dc365dce00946080ccc482fc20a6b6c1476b</id>
<content type='text'>
commit d7d824966530acfe32b94d1ed672e6fe1638cd68 upstream.

When changing a file's acl mask, btrfs_set_acl() will first set the
group bits of i_mode to the value of the mask, and only then set the
actual extended attribute representing the new acl.

If the second part fails (due to lack of space, for example) and the
file had no acl attribute to begin with, the system will from now on
assume that the mask permission bits are actual group permission bits,
potentially granting access to the wrong users.

Prevent this by restoring the original mode bits if __btrfs_set_acl
fails.

Signed-off-by: Ernesto A. Fernández &lt;ernesto.mnd.fernandez@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>btrfs: Don't clear SGID when inheriting ACLs</title>
<updated>2017-10-12T14:27:12Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2017-06-22T13:31:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3cc349456aa367a26e6f731cca031bd3b67540d9'/>
<id>urn:sha1:3cc349456aa367a26e6f731cca031bd3b67540d9</id>
<content type='text'>
commit b7f8a09f8097db776b8d160862540e4fc1f51296 upstream.

When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
set, DIR1 is expected to have SGID bit set (and owning group equal to
the owning group of 'DIR0'). However when 'DIR0' also has some default
ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
'DIR1' to get cleared if user is not member of the owning group.

Fix the problem by moving posix_acl_update_mode() out of
__btrfs_set_acl() into btrfs_set_acl(). That way the function will not be
called when inheriting ACLs which is what we want as it prevents SGID
bit clearing and the mode has been properly set by posix_acl_create()
anyway.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
CC: linux-btrfs@vger.kernel.org
CC: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
[bwh: Backported to 3.2: move the call to posix_acl_update_mode() into
 btrfs_xattr_acl_set()]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>posix_acl: Clear SGID bit when setting file permissions</title>
<updated>2016-11-20T01:01:44Z</updated>
<author>
<name>Jan Kara</name>
</author>
<published>2016-09-19T15:39:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a06d3be52bce98746341cfb290203603fd028290'/>
<id>urn:sha1:a06d3be52bce98746341cfb290203603fd028290</id>
<content type='text'>
commit 073931017b49d9458aa351605b43a7e34598caef upstream.

When file permissions are modified via chmod(2) and the user is not in
the owning group or capable of CAP_FSETID, the setgid bit is cleared in
inode_change_ok().  Setting a POSIX ACL via setxattr(2) sets the file
permissions as well as the new ACL, but doesn't clear the setgid bit in
a similar way; this allows to bypass the check in chmod(2).  Fix that.

References: CVE-2016-7097
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Jeff Layton &lt;jlayton@redhat.com&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Andreas Gruenbacher &lt;agruenba@redhat.com&gt;
[bwh: Backported to 3.2:
 - Drop changes to ceph, f2fs, hfsplus, orangefs
 - Use capable() instead of capable_wrt_inode_uidgid()
 - Update ext3 and generic_acl.c as well
 - In gfs2, jfs, and xfs, take care to avoid leaking the allocated ACL if
   posix_acl_update_mode() determines it's not needed
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Btrfs: skip adding an acl attribute if we don't have to</title>
<updated>2016-11-20T01:01:44Z</updated>
<author>
<name>Liu Bo</name>
</author>
<published>2012-11-28T10:43:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cef37d3ae1c1847b553e22160fe33f2892bd39d4'/>
<id>urn:sha1:cef37d3ae1c1847b553e22160fe33f2892bd39d4</id>
<content type='text'>
commit 755ac67f83e515af55adbfe55134eb7d90839cdb upstream.

If the acl can be exactly represented in the traditional file
mode permission bits, we don't set another acl attribute.

Signed-off-by: Liu Bo &lt;bo.li.liu@oracle.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@fusionio.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>Btrfs: fix return value of btrfs_get_acl()</title>
<updated>2011-10-20T16:10:47Z</updated>
<author>
<name>Tsutomu Itoh</name>
</author>
<published>2011-10-06T04:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cfbffc39ac89dbd5197cbeec2599a1128eb928f8'/>
<id>urn:sha1:cfbffc39ac89dbd5197cbeec2599a1128eb928f8</id>
<content type='text'>
In btrfs_get_acl(), when the second __btrfs_getxattr() call fails,
acl is not correctly set.
Therefore, a wrong value might return to the caller.

Signed-off-by: Tsutomu Itoh &lt;t-itoh@jp.fujitsu.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable</title>
<updated>2011-08-03T07:14:05Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2011-08-03T07:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed8f37370d83e695c0a4fa5d5fc7a83ecb947526'/>
<id>urn:sha1:ed8f37370d83e695c0a4fa5d5fc7a83ecb947526</id>
<content type='text'>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: (31 commits)
  Btrfs: don't call writepages from within write_full_page
  Btrfs: Remove unused variable 'last_index' in file.c
  Btrfs: clean up for find_first_extent_bit()
  Btrfs: clean up for wait_extent_bit()
  Btrfs: clean up for insert_state()
  Btrfs: remove unused members from struct extent_state
  Btrfs: clean up code for merging extent maps
  Btrfs: clean up code for extent_map lookup
  Btrfs: clean up search_extent_mapping()
  Btrfs: remove redundant code for dir item lookup
  Btrfs: make acl functions really no-op if acl is not enabled
  Btrfs: remove remaining ref-cache code
  Btrfs: remove a BUG_ON() in btrfs_commit_transaction()
  Btrfs: use wait_event()
  Btrfs: check the nodatasum flag when writing compressed files
  Btrfs: copy string correctly in INO_LOOKUP ioctl
  Btrfs: don't print the leaf if we had an error
  btrfs: make btrfs_set_root_node void
  Btrfs: fix oops while writing data to SSD partitions
  Btrfs: Protect the readonly flag of block group
  ...

Fix up trivial conflicts (due to acl and writeback cleanups) in
 - fs/btrfs/acl.c
 - fs/btrfs/ctree.h
 - fs/btrfs/extent_io.c
</content>
</entry>
<entry>
<title>Btrfs: make acl functions really no-op if acl is not enabled</title>
<updated>2011-08-01T18:30:48Z</updated>
<author>
<name>Li Zefan</name>
</author>
<published>2011-07-14T03:17:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9b89d95a143bb0a9abc4ba0fdcdda78211930f1a'/>
<id>urn:sha1:9b89d95a143bb0a9abc4ba0fdcdda78211930f1a</id>
<content type='text'>
So there's no overhead for something we don't use.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>switch posix_acl_equiv_mode() to umode_t *</title>
<updated>2011-08-01T06:10:06Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2011-07-23T22:56:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d6952123b53cc8b334df69bba2cd0063b0d88f68'/>
<id>urn:sha1:d6952123b53cc8b334df69bba2cd0063b0d88f68</id>
<content type='text'>
... so that &amp;inode-&gt;i_mode could be passed to it

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>switch posix_acl_create() to umode_t *</title>
<updated>2011-08-01T06:09:42Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2011-07-23T22:37:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3fb612076eebec6f67257db0c7a9666ac7e5892'/>
<id>urn:sha1:d3fb612076eebec6f67257db0c7a9666ac7e5892</id>
<content type='text'>
so we can pass &amp;inode-&gt;i_mode to it

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>fs: take the ACL checks to common code</title>
<updated>2011-07-25T18:30:23Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2011-07-23T15:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4e34e719e457f2e031297175410fc0bd4016a085'/>
<id>urn:sha1:4e34e719e457f2e031297175410fc0bd4016a085</id>
<content type='text'>
Replace the -&gt;check_acl method with a -&gt;get_acl method that simply reads an
ACL from disk after having a cache miss.  This means we can replace the ACL
checking boilerplate code with a single implementation in namei.c.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
