diff --git a/fs/incfs/vfs.c b/fs/incfs/vfs.c index fe5a104ac806..cde9fe992da2 100644 --- a/fs/incfs/vfs.c +++ b/fs/incfs/vfs.c @@ -1608,6 +1608,10 @@ static int incfs_setattr(struct user_namespace *ns, struct dentry *dentry, if (ia->ia_valid & ATTR_SIZE) return -EINVAL; + if ((ia->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && + (ia->ia_valid & ATTR_MODE)) + return -EINVAL; + if (!di) return -EINVAL; backing_dentry = di->backing_path.dentry;