linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 06/11] kill suid bit only for regular files
@ 2008-12-01 22:34 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2008-12-01 22:34 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, akpm, dmonakhov

From: Dmitri Monakhov <dmonakhov@openvz.org>

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>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/filemap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/filemap.c~kill-suid-bit-only-for-regular-files mm/filemap.c
--- a/mm/filemap.c~kill-suid-bit-only-for-regular-files
+++ a/mm/filemap.c
@@ -1766,7 +1766,7 @@ int should_remove_suid(struct dentry *de
 	if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
 		kill |= ATTR_KILL_SGID;
 
-	if (unlikely(kill && !capable(CAP_FSETID)))
+	if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode)))
 		return kill;
 
 	return 0;
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-01 22:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01 22:34 [patch 06/11] kill suid bit only for regular files akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).