kill suid bit only for regular files
Subsystems (3)
[email protected]
maintainerPATCH 6/11 kill suid bit only for regular files
From: Dmitri Monakhov <[email protected]>
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 <[email protected]>
Cc Al Viro <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/filemap.c renamed from mm/filemap.c~kill-suid-bit-only-for-regular-files +1 -1
@@ -1766,7 +1766,7 @@ int should_remove_suid(struct dentry *deif (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 ;
_