Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1465441rwi; Wed, 19 Oct 2022 10:55:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5m4YRiuvPhO8hdvfWV+UxpRP1ZhndLTPIheajJf2YCS+ZJYn92xTp4fuALFtI0js/1UTWY X-Received: by 2002:a05:6402:1941:b0:457:138:1e88 with SMTP id f1-20020a056402194100b0045701381e88mr8760680edz.394.1666202117217; Wed, 19 Oct 2022 10:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666202117; cv=none; d=google.com; s=arc-20160816; b=mDNOZgtj4MJWsGaBD7hMhwd2wdsQXKXTXyiV6w70lFAo1KYGRm9RaZFEtQP2HSeyRJ I3AzvmMky2SJR2uaMe4sU6fUJdwMmFTaLIc/p0fXBZrECpbiRJ3k/PgCBqYFk7m6ypVq 4H6vVrf3EmzFUn4jYpJQw8JwZDAWhM3TyNM7MxcFtVyNaOWW4AwJIq6dt+s837GhBO2m NcU5yozhIh/lPW+Knr66jCEjQ0TlSM0HQUyfE8rZCeA9y5qNUCiqOqZNFL+ihO+kBbMB kwhXQHTGlE18a0tgt19NrJrKuVx2zVWieZ2KArVcvwaSZSrcft8jGIkrfAlabQRAUtE4 tOxA== 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=mzeTLwmyjFShA+M5MwzvqAFcpwXwIBG+eDKsep2bAts=; b=w87AQok7kLS2EjrivUUyloYpkYef1+4bvxRc4G6Y+jTwXxvCpLdNl8DGLaaR3YTV7f LkUKom/jtslJMVQDpzKtmIkHl+zihjIUrp2W9KnM2Kp/t2PaecNhe01FeS0EMo/E0Kno Xhbc0TybdHO3FEtLlGXKYZ6/JOl5k/9vXxkLtAB+icobFvZRfy3zb3ScIHPSDWoGJp2S rDjoIb19CE0HnA4ptTwuvYqAaT9GPScuQa0d3+v+3Zrny34t+EvGRl8n7nva49QKihLF e4XDMraq/hy1qi5ykIqfflmG2VEea9WmAJLx9OTiNlT23odV0b92krPNijeCZ+VjObF8 XC5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pMtxroik; 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 t22-20020a1709067c1600b0078a76811e33si12717969ejo.408.2022.10.19.10.54.51; Wed, 19 Oct 2022 10:55:17 -0700 (PDT) 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=pMtxroik; 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 S230148AbiJSRnn (ORCPT + 99 others); Wed, 19 Oct 2022 13:43:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbiJSRnn (ORCPT ); Wed, 19 Oct 2022 13:43:43 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F5261C5E15 for ; Wed, 19 Oct 2022 10:43:41 -0700 (PDT) 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 D674FB82572 for ; Wed, 19 Oct 2022 17:43:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 483EAC433C1; Wed, 19 Oct 2022 17:43:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666201418; bh=zhorUzccnj4fCYEMYcILKuGLYfRQ/Z25KahCPnqRaX8=; h=From:To:Cc:Subject:Date:From; b=pMtxroiky/lQMR2Iw10s8ivBm6wRtnuK6KsElu5NqxHYsdFIKkUMPU7PFdQdMZ7EY YIYvN+JJLZAG3OpulHoGcnyASX57LLZQcf3YDgwl+UjIy1xBhuNn6tjVfAo/damVIW MxnGWfY/7JflbHrVfDEKO8gM4JAqmmHgrKQvc7ZnxBVWpQlmvdLPuKQ3EtzKmcC2+5 JNjLKP1XNZvK85+PCk8HgDxKWEVKQSXD5Lt2hudOO+GOwv73Vur/L2gnD3dsQOIq2A lEnOc0VaWNqkaJNIK3uB63mwI4dYg5/lP5ZF5VEPAtTeQQdvnyh3wmkauXyEtizyBz DgLcvs3TID+rg== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 1/4] NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding Date: Wed, 19 Oct 2022 13:36:48 -0400 Message-Id: <20221019173651.32096-1-trondmy@kernel.org> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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 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 We need to clear the FATTR4_WORD2_SECURITY_LABEL bitmap flag irrespective of whether or not the label is too long. Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4xdr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index acfe5f4bda48..8c5298e37f0f 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -4234,6 +4234,7 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap, p = xdr_inline_decode(xdr, len); if (unlikely(!p)) return -EIO; + bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL; if (len < NFS4_MAXLABELLEN) { if (label) { if (label->len) { @@ -4246,7 +4247,6 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap, label->lfs = lfs; status = NFS_ATTR_FATTR_V4_SECURITY_LABEL; } - bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL; } else printk(KERN_WARNING "%s: label too long (%u)!\n", __func__, len); -- 2.37.3