linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSD: Checking whether kill_suid by should_remove_suid()
@ 2014-04-13 15:11 Kinglong Mee
  2014-04-18 13:02 ` J. Bruce Fields
  0 siblings, 1 reply; 11+ messages in thread
From: Kinglong Mee @ 2014-04-13 15:11 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs

As local filesystem, writing data to the file by non-owner will
clears the SUID+SGID, owner will not.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/vfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 16f0673..19c0931 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -943,7 +943,7 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh
*fhp, struct file *file,
 	fsnotify_modify(file);

 	/* clear setuid/setgid flag after write */
-	if (inode->i_mode & (S_ISUID | S_ISGID))
+	if (should_remove_suid(dentry))
 		kill_suid(dentry);

 	if (stable) {
-- 
1.9.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-05-16 15:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-13 15:11 [PATCH] NFSD: Checking whether kill_suid by should_remove_suid() Kinglong Mee
2014-04-18 13:02 ` J. Bruce Fields
2014-04-18 13:51   ` Kinglong Mee
2014-04-18 16:17     ` [PATCH v2] NFSD: Don't clear SUID/SGID after root writing data Kinglong Mee
2014-05-08 16:12       ` J. Bruce Fields
2014-05-09  7:55         ` Kinglong Mee
2014-05-09 21:40           ` J. Bruce Fields
2014-05-10  5:10             ` Christoph Hellwig
2014-05-16  7:31               ` Kinglong Mee
2014-05-16 15:12                 ` Christoph Hellwig
2014-04-18 16:25   ` [PATCH] NFSD: Checking whether kill_suid by should_remove_suid() Kinglong Mee

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).