lkml.org 
[lkml]   [2011]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mm: add missing mutex lock arround notify_change

Calls to notify_change() must hold i_mutex.

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
---
mm/filemap.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index c106d3b..0670ec1 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1994,10 +1994,16 @@ EXPORT_SYMBOL(should_remove_suid);

static int __remove_suid(struct dentry *dentry, int kill)
{
+ int ret;
struct iattr newattrs;

newattrs.ia_valid = ATTR_FORCE | kill;
- return notify_change(dentry, &newattrs);
+
+ mutex_lock(&dentry->d_inode->i_mutex);
+ ret = notify_change(dentry, &newattrs);
+ mutex_unlock(&dentry->d_inode->i_mutex);
+
+ return ret;
}

int file_remove_suid(struct file *file)
--
1.7.1

\
 
 \ /
  Last update: 2011-12-16 12:25    [W:0.940 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site