From 33666ca081c11cf7b426ce89bc19dd38b012f555 Mon Sep 17 00:00:00 2001 From: y30045862 Date: Sat, 2 Nov 2024 15:48:48 +0800 Subject: [PATCH] sharefs setattr not allow chmod or chown Signed-off-by: yangjingbo10 --- fs/sharefs/inode.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/sharefs/inode.c b/fs/sharefs/inode.c index e31baf4bd415..64d5415de531 100644 --- a/fs/sharefs/inode.c +++ b/fs/sharefs/inode.c @@ -308,12 +308,7 @@ static int sharefs_setattr(struct dentry *dentry, struct iattr *ia) truncate_setsize(inode, ia->ia_size); } - /* - * mode change is for clearing setuid/setgid bits. Allow lower fs - * to interpret this in its own way. - */ - if (lower_ia.ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID)) - lower_ia.ia_valid &= ~ATTR_MODE; + lower_ia.ia_valid &= ~(ATTR_MODE|ATTR_UID|ATTR_GID); /* notify the (possibly copied-up) lower inode */ /* -- Gitee