From 726edab7802b0c1c39f768883efc01cb9346b8cc Mon Sep 17 00:00:00 2001 From: tl Date: Thu, 31 Oct 2024 10:28:34 +0800 Subject: [PATCH] sharefs setattr not allow chmod or chown Signed-off-by: tl --- 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 7bd08abe79ea..b5808830365f 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