mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
vfs: extend vfs_removexattr locking
This patch takes the i_mutex lock before security_inode_removexattr(), instead of after, in preparation of calling ima_inode_removexattr(). Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
This commit is contained in:
parent
2e4930eb7c
commit
2ab51f3721
10
fs/xattr.c
10
fs/xattr.c
@ -295,11 +295,13 @@ vfs_removexattr(struct dentry *dentry, const char *name)
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
error = security_inode_removexattr(dentry, name);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
mutex_lock(&inode->i_mutex);
|
||||
error = security_inode_removexattr(dentry, name);
|
||||
if (error) {
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
return error;
|
||||
}
|
||||
|
||||
error = inode->i_op->removexattr(dentry, name);
|
||||
mutex_unlock(&inode->i_mutex);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user