]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: Correctly lock inode when removing suid and file capabilities
authorJan Kara <jack@suse.cz>
Thu, 21 May 2015 14:05:56 +0000 (16:05 +0200)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 29 May 2017 00:52:45 +0000 (17:52 -0700)
commit426c1beab438b8c3f7943d96a3b1cb8d1849ce50
tree75db784b07312c45bc78e5b9d2338794d2fa125b
parent96c4a361b2188cb231fb7e24b12857af3a9290d7
xfs: Correctly lock inode when removing suid and file capabilities

From a6de82cab123beaf9406024943caa0242f0618b0 Mon Sep 17 00:00:00 2001

Currently XFS calls file_remove_privs() without holding i_mutex. This is
wrong because that function can end up messing with file permissions and
file capabilities stored in xattrs for which we need i_mutex held.

Fix the problem by grabbing iolock exclusively when we will need to
change anything in permissions / xattrs.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Orabug: 24803533
Signed-off-by: darrick.wong@oracle.com
fs/xfs/xfs_file.c