Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp215054pxm; Tue, 22 Feb 2022 21:27:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW2JmGeJ/XW3EVckGvxFDeBSYzks99tHi39JB8nnazuE+Hbw3lf6WvQ+UiJjdF8Nqu+GhT X-Received: by 2002:a65:5186:0:b0:372:f0d0:3974 with SMTP id h6-20020a655186000000b00372f0d03974mr21891102pgq.364.1645594025405; Tue, 22 Feb 2022 21:27:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645594025; cv=none; d=google.com; s=arc-20160816; b=MOFV2dmfJOWjU4dI1U9QFEnsVLnaeQgj5QR5SDYDVEFIJBLl8zKXAgAkuFLOxza2LC MGR2utZ7+Bi/IANyzgIG9ZsHUSdCo9k34tQycTqsfIlJdxyUhvhcqno6sLCNrJMljnGC 0+vXFozG+Pj8O6KQ5NYj/zfbL3Xy+yo9vY0rWo4wxGjhh1R5naZVAVaLvtbU0c+0O87g 2Z016XLANPY5IrHgVRy3o1sJLQH6LNVhUmMzGDFeN13alRbxc4Gvt08EgwtHDPkRbdVO xUOOp1AkayW/lnxKiPIU+pQzD0wCm5bSIMjpKBSBI4nqlC2+l8L7hnLawCTqrhTKAulL BcwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=HsvuzXAZ6Xb4jmfAGPpNNjHJwFLJdya8snDAVXwGQdk=; b=0DGmt7goaqX91/qDAdJRb0nM7DZbyI6GpTqofW3Gl0w/kchw9tY3cr00Aw2O7iXOzH 1wLAUpqEY6OkAbb9LczXPKQaXyXPq+XjY/2TsAUg/xPEaQqAY7S8njLtg2J4JduT8KZk vIwTBHIy0BUoPNZJWKFqMQ4bHutiQ1qWl+6cUBB+RD4MKGRmngcnQXJF+zi4KYy1kWnj jCCqV1yej8MJQw3qHAOHGZAK2BG3id/Zx9dxoK7jIy77P70iThAnLHTYW41gdgpBqxN7 nkbcpCJnW2101lQlp7a7Sf9iZB74rTTI0wBFV8zbv757IJJQ65QsgW85u9yCZscuJr1I D5Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O7xpl9ld; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t38si14440552pfg.98.2022.02.22.21.26.36; Tue, 22 Feb 2022 21:27:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O7xpl9ld; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236332AbiBWAEY (ORCPT + 99 others); Tue, 22 Feb 2022 19:04:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234124AbiBWAEW (ORCPT ); Tue, 22 Feb 2022 19:04:22 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49450DF5 for ; Tue, 22 Feb 2022 16:03:56 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 000A3B81CA8 for ; Wed, 23 Feb 2022 00:03:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E73DC340E8; Wed, 23 Feb 2022 00:03:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645574633; bh=5AnU2U/r9nlmACdUQEefVj4WV6rRsj1WFaouTuf6n1I=; h=From:To:Cc:Subject:Date:From; b=O7xpl9ldH8EURP1c/YrFBVv/Dt9x1uvuGWvxeEz6rqY4lWXEtK92AagSd9lV8rhH1 pDaV2AVV7UiBnXjPx4QSJl7AFsRBYtGEh3BXHibae3Z/8dUSQOIETs8u9hBwdFq4yL kUemH5+ruT9DCxCwDzJJ1uGzfpSj6Us+1cgnDmlOyPeNg4bkxUsjU6uHew2EBrox6A NduuD57FBI1elcnPl3XvyOwHKP2smvMR4uFJi3uhRdo4R6TBp56qRpGHL17Jnn9YZC ABCPzeHYn0ba9utb4RpafzQEnsyExNhPcbR7j4+/qFrQeTM8pyiBWLyfUErT6OIonU C95/V0eQtu6EA== From: trondmy@kernel.org To: Olga Kornievskaia Cc: linux-nfs@vger.kernel.org Subject: [PATCH] NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR Date: Tue, 22 Feb 2022 18:57:27 -0500 Message-Id: <20220222235727.1157439-1-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Trond Myklebust Ensure that we always initialise the 'xattr_support' field in struct nfs_fsinfo, so that nfs_server_set_fsinfo() doesn't declare our NFSv2/v3 client to be capable of supporting the NFSv4.2 xattr protocol by setting the NFS_CAP_XATTR capability. This configuration can cause nfs_do_access() to set access mode bits that are unsupported by the NFSv3 ACCESS call, which may confuse spec-compliant servers. Reported-by: Olga Kornievskaia Fixes: b78ef845c35d ("NFSv4.2: query the server for extended attribute support") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust --- fs/nfs/nfs3xdr.c | 1 + fs/nfs/proc.c | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index feb6e2e36138..296320f91579 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c @@ -2229,6 +2229,7 @@ static int decode_fsinfo3resok(struct xdr_stream *xdr, /* ignore properties */ result->lease_time = 0; result->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED; + result->xattr_support = 0; return 0; } diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 73dcaa99fa9b..e3570c656b0f 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -92,6 +92,7 @@ nfs_proc_get_root(struct nfs_server *server, struct nfs_fh *fhandle, info->maxfilesize = 0x7FFFFFFF; info->lease_time = 0; info->change_attr_type = NFS4_CHANGE_TYPE_IS_UNDEFINED; + info->xattr_support = 0; return 0; } -- 2.35.1