aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorDmitri Monakhov <dmonakhov@openvz.org>2008-12-01 17:34:56 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2009-01-05 11:53:07 -0500
commit7f5ff766a7babd72fc192125e12ef5570effff4c (patch)
treec41659d7614ea70c3dc853c6187f1860d030888b /mm/filemap.c
parent5b6f1eb97d462a45be3b30759758b5fdbb562c8c (diff)
kill suid bit only for regular files
We don't have to do it because it is useless for non regular files. In fact block device may trigger this path without dentry->d_inode->i_mutex. (akpm: concerns were expressed (by me) about S_ISDIR inodes) Signed-off-by: Dmitri Monakhov <dmonakhov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index f3e5f8944d17..ed53ce876259 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1766,7 +1766,7 @@ int should_remove_suid(struct dentry *dentry)
1766 if (unlikely((mode & S_ISGID) && (mode & S_IXGRP))) 1766 if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
1767 kill |= ATTR_KILL_SGID; 1767 kill |= ATTR_KILL_SGID;
1768 1768
1769 if (unlikely(kill && !capable(CAP_FSETID))) 1769 if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode)))
1770 return kill; 1770 return kill;
1771 1771
1772 return 0; 1772 return 0;