Skip to content

Commit 9c3580a

Browse files
Miklos Szereditorvalds
authored andcommitted
ecryptfs: add missing lock around notify_change
Callers of notify_change() need to hold i_mutex. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Cc: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 18d1dbf commit 9c3580a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/ecryptfs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
908908
if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
909909
ia->ia_valid &= ~ATTR_MODE;
910910

911+
mutex_lock(&lower_dentry->d_inode->i_mutex);
911912
rc = notify_change(lower_dentry, ia);
913+
mutex_unlock(&lower_dentry->d_inode->i_mutex);
912914
out:
913915
fsstack_copy_attr_all(inode, lower_inode, NULL);
914916
return rc;

0 commit comments

Comments
 (0)