From: Miklos Szeredi Date: Tue, 29 Apr 2008 07:59:48 +0000 (-0700) Subject: ecryptfs: add missing lock around notify_change X-Git-Tag: v2.6.26-rc1~600 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c3580aa52195699065bc2d7242b1c7e3e6903fa;p=linux-2.6 ecryptfs: add missing lock around notify_change Callers of notify_change() need to hold i_mutex. Signed-off-by: Miklos Szeredi Cc: Michael Halcrow Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index a7d5d7d2b2..1623ebf25e 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -908,7 +908,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia) if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) ia->ia_valid &= ~ATTR_MODE; + mutex_lock(&lower_dentry->d_inode->i_mutex); rc = notify_change(lower_dentry, ia); + mutex_unlock(&lower_dentry->d_inode->i_mutex); out: fsstack_copy_attr_all(inode, lower_inode, NULL); return rc;