<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/fs/f2fs/acl.c, branch linux-4.4.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2019-02-20T09:13:06+00:00</updated>
<entry>
<title>f2fs: fix wrong return value of f2fs_acl_create</title>
<updated>2019-02-20T09:13:06+00:00</updated>
<author>
<name>Tiezhu Yang</name>
<email>kernelpatch@126.com</email>
</author>
<published>2018-11-20T23:21:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d67dec906b7a9069c5541fce2b50118178133a1a'/>
<id>urn:sha1:d67dec906b7a9069c5541fce2b50118178133a1a</id>
<content type='text'>
[ Upstream commit f6176473a0c7472380eef72ebeb330cf9485bf0a ]

When call f2fs_acl_create_masq() failed, the caller f2fs_acl_create()
should return -EIO instead of -ENOMEM, this patch makes it consistent
with posix_acl_create() which has been fixed in commit beaf226b863a
("posix_acl: don't ignore return value of posix_acl_create_masq()").

Fixes: 83dfe53c185e ("f2fs: fix reference leaks in f2fs_acl_create")
Signed-off-by: Tiezhu Yang &lt;kernelpatch@126.com&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: Don't clear SGID when inheriting ACLs</title>
<updated>2017-07-27T22:06:07+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2017-07-11T21:56:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fca8859982fb0e591c9baa10f1ba7c405dd5a120'/>
<id>urn:sha1:fca8859982fb0e591c9baa10f1ba7c405dd5a120</id>
<content type='text'>
commit c925dc162f770578ff4a65ec9b08270382dba9e6 upstream.

This patch copies commit b7f8a09f80:
"btrfs: Don't clear SGID when inheriting ACLs" written by Jan.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Reviewed-by: Chao Yu &lt;yuchao0@huawei.com&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>posix_acl: Clear SGID bit when setting file permissions</title>
<updated>2016-10-31T10:13:58+00:00</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2016-09-19T15:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=57c9cfdb61ea270936fab76da99a742c6ef0b86f'/>
<id>urn:sha1:57c9cfdb61ea270936fab76da99a742c6ef0b86f</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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>f2fs: make posix_acl_create() safer and cleaner</title>
<updated>2015-05-07T18:38:31+00:00</updated>
<author>
<name>Chao Yu</name>
<email>chao2.yu@samsung.com</email>
</author>
<published>2015-04-18T10:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=272e083f7a968bc81dd01e4f16860a1e9617d454'/>
<id>urn:sha1:272e083f7a968bc81dd01e4f16860a1e9617d454</id>
<content type='text'>
Our f2fs_acl_create is copied from posix_acl_create in ./fs/posix_acl.c and
modified to avoid deadlock bug when inline_dentry feature is enabled.

Dan Carpenter rewrites posix_acl_create in commit 2799563b281f
("fs/posix_acl.c: make posix_acl_create() safer and cleaner") to make this
function more safer, so that we can avoid potential bug in its caller,
especially for ocfs2.

Let's back port the patch to f2fs.

Signed-off-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix reference leaks in f2fs_acl_create</title>
<updated>2015-04-10T22:08:40+00:00</updated>
<author>
<name>Chao Yu</name>
<email>chao2.yu@samsung.com</email>
</author>
<published>2015-03-09T10:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=83dfe53c185e3554c102708c70dc1e5ff4bcac2c'/>
<id>urn:sha1:83dfe53c185e3554c102708c70dc1e5ff4bcac2c</id>
<content type='text'>
Our f2fs_acl_create is copied and modified from posix_acl_create to avoid
deadlock bug when inline_dentry feature is enabled.

Now, we got reference leaks in posix_acl_create, and this has been fixed in
commit fed0b588be2f ("posix_acl: fix reference leaks in posix_acl_create")
by Omar Sandoval.
https://lkml.org/lkml/2015/2/9/5

Let's fix this issue in f2fs_acl_create too.

Signed-off-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Reviewed-by: Changman Lee &lt;cm224.lee@ssamsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: fix a bug of inheriting default ACL from parent</title>
<updated>2015-02-12T01:04:36+00:00</updated>
<author>
<name>Kinglong Mee</name>
<email>kinglongmee@gmail.com</email>
</author>
<published>2015-01-24T09:06:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b6709b771b3335856643df8f6e0158db150a438'/>
<id>urn:sha1:3b6709b771b3335856643df8f6e0158db150a438</id>
<content type='text'>
Introduced by a6dda0e63e97122ce9e0ba04367e37cca28315fa
"f2fs: use generic posix ACL infrastructure".

When testing default acl, gets in recent kernel (3.19.0-rc5),
user::rwx
group::r-x
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

]# getfacl testdir/
user::rwx
group::rwx
                // missing an acl "group:root:rwx" inherited from parent
other::r-x
default:user::rwx
default:group::r-x
default:group:root:rwx
default:mask::rwx
default:other::r-x

Signed-off-by: Kinglong Mee &lt;kinglongmee@gmail.com&gt;
Reviewed-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: avoid double lock for cp_rwsem</title>
<updated>2015-01-10T01:02:25+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-12-19T03:32:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dd802406e396c22dfb5aa0d16196f04d515be49e'/>
<id>urn:sha1:dd802406e396c22dfb5aa0d16196f04d515be49e</id>
<content type='text'>
The __f2fs_add_link is covered by cp_rwsem all the time.
This calls init_inode_metadata, which conducts some acl operations including
memory allocation with GFP_KERNEL previously.
But, under memory pressure, f2fs_write_data_page can be called, which also
grabs cp_rwsem too.

In this case, this incurs a deadlock pointed by Chao.
Thread #1        Thread #2
 down_read
                 down_write
  down_read
 -&gt; here down_read should wait forever.

Reviewed-by: Chao Yu &lt;chao2.yu@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: remove the redundant function cond_clear_inode_flag</title>
<updated>2014-11-04T00:07:36+00:00</updated>
<author>
<name>Gu Zheng</name>
<email>guz.fnst@cn.fujitsu.com</email>
</author>
<published>2014-10-20T09:45:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fa528722d06ecbee9d918b9eec58c5d4c2978839'/>
<id>urn:sha1:fa528722d06ecbee9d918b9eec58c5d4c2978839</id>
<content type='text'>
Use clear_inode_flag to replace the redundant cond_clear_inode_flag.

Signed-off-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: avoid deadlock on init_inode_metadata</title>
<updated>2014-11-04T00:07:33+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk@kernel.org</email>
</author>
<published>2014-10-14T02:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bce8d1120707c06088928b2ee52a58703d74ac29'/>
<id>urn:sha1:bce8d1120707c06088928b2ee52a58703d74ac29</id>
<content type='text'>
Previously, init_inode_metadata does not hold any parent directory's inode
page. So, f2fs_init_acl can grab its parent inode page without any problem.
But, when we use inline_dentry, that page is grabbed during f2fs_add_link,
so that we can fall into deadlock condition like below.

INFO: task mknod:11006 blocked for more than 120 seconds.
      Tainted: G           OE  3.17.0-rc1+ #13
"echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
mknod           D ffff88003fc94580     0 11006  11004 0x00000000
 ffff880007717b10 0000000000000002 ffff88003c323220 ffff880007717fd8
 0000000000014580 0000000000014580 ffff88003daecb30 ffff88003c323220
 ffff88003fc94e80 ffff88003ffbb4e8 ffff880007717ba0 0000000000000002
Call Trace:
 [&lt;ffffffff8173dc40&gt;] ? bit_wait+0x50/0x50
 [&lt;ffffffff8173d4cd&gt;] io_schedule+0x9d/0x130
 [&lt;ffffffff8173dc6c&gt;] bit_wait_io+0x2c/0x50
 [&lt;ffffffff8173da3b&gt;] __wait_on_bit_lock+0x4b/0xb0
 [&lt;ffffffff811640a7&gt;] __lock_page+0x67/0x70
 [&lt;ffffffff810acf50&gt;] ? autoremove_wake_function+0x40/0x40
 [&lt;ffffffff811652cc&gt;] pagecache_get_page+0x14c/0x1e0
 [&lt;ffffffffa029afa9&gt;] get_node_page+0x59/0x130 [f2fs]
 [&lt;ffffffffa02a63ad&gt;] read_all_xattrs+0x24d/0x430 [f2fs]
 [&lt;ffffffffa02a6ca2&gt;] f2fs_getxattr+0x52/0xe0 [f2fs]
 [&lt;ffffffffa02a7481&gt;] f2fs_get_acl+0x41/0x2d0 [f2fs]
 [&lt;ffffffff8122d847&gt;] get_acl+0x47/0x70
 [&lt;ffffffff8122db5a&gt;] posix_acl_create+0x5a/0x150
 [&lt;ffffffffa02a7759&gt;] f2fs_init_acl+0x29/0xcb [f2fs]
 [&lt;ffffffffa0286a8d&gt;] init_inode_metadata+0x5d/0x340 [f2fs]
 [&lt;ffffffffa029253a&gt;] f2fs_add_inline_entry+0x12a/0x2e0 [f2fs]
 [&lt;ffffffffa0286ea5&gt;] __f2fs_add_link+0x45/0x4a0 [f2fs]
 [&lt;ffffffffa028b5b6&gt;] ? f2fs_new_inode+0x146/0x220 [f2fs]
 [&lt;ffffffffa028b816&gt;] f2fs_mknod+0x86/0xf0 [f2fs]
 [&lt;ffffffff811e3ec1&gt;] vfs_mknod+0xe1/0x160
 [&lt;ffffffff811e4b26&gt;] SyS_mknod+0x1f6/0x200
 [&lt;ffffffff81741d7f&gt;] tracesys+0xe1/0xe6

Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
<entry>
<title>f2fs: remove the redundant validation check of acl</title>
<updated>2014-07-09T21:04:25+00:00</updated>
<author>
<name>Gu Zheng</name>
<email>guz.fnst@cn.fujitsu.com</email>
</author>
<published>2014-06-24T10:18:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=34e6d456da4a61f655655a6d431657da5753913f'/>
<id>urn:sha1:34e6d456da4a61f655655a6d431657da5753913f</id>
<content type='text'>
kernel side(xx_init_acl), the acl is get/cloned from the parent dir's,
which is credible. So remove the redundant validation check of acl
here.

Signed-off-by: Gu Zheng &lt;guz.fnst@cn.fujitsu.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk@kernel.org&gt;
</content>
</entry>
</feed>
