Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp161929rwi; Tue, 18 Oct 2022 15:46:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hgKox2ocOBIveTi2RfUD/lC7lxg+wSw3DX6QSWektVBXetUSQUbxwPGaQhwc5KDCEGSxg X-Received: by 2002:aa7:de9a:0:b0:44d:8191:44c5 with SMTP id j26-20020aa7de9a000000b0044d819144c5mr4564657edv.232.1666133193580; Tue, 18 Oct 2022 15:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666133193; cv=none; d=google.com; s=arc-20160816; b=beoZR/wnODFlq3ou46f8FW2l6eW+CG98tVvbUZMMHxwWy/fEWy3mN39MBL99LeHTVz U4cz7SzDHicWHoV5QV/Vn32SL6kksf6OOlR5cskvYEIsiRBGi3Qqk0URduWObOH4vacN t0MBX29jmM3bAaVhOf0BSZFltvkV+LNYG/F9V6SgSwVymmv4pPPUatOSbAclnHxwC8lP RPPsPX1PIyHAGZIGJpKoJxdnns60YsOs7UEhBwjjKp1qVZ3vvQ+YJAeAFd+ntpztu6+g UwOjFi0zgsKLE0Eoohg8whz6NoDBGpIcUzvAUinaO6ycpucO1ZvVvQdSB4RZK7ZyRfAq 7XVg== 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=gU47zVHvNDD/y0zQOCialCkRsJq2I6BeE9Kiqp5UTgdaO4Dx4qbodhK8J7+2rPwQHQ Ebd7814nrlV/BvScugi4bcKx217tMqPZjr+c5QW4I7oaNGvy+tGPoJe0vt1T10a1JE7q 4qM7UfqrICSjKKf5H9Uyr5EEXOzYPgPIQJL30y2P4naf42AZalMm6JjzsCvWUOBDp2fK khXCXb0YWXRSR6gzoGiwHMQVnNrc1l6gQ9oX1MvNH5beaT8wKuvixT8kY32CQkSPdtat WRsmz/6/9mH0QOmwmQu/V5r6u8u252LRJMV36FpWDjdj+gAtEXyyG4lLenEa7DNkImL8 voIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=odfFc63x; 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 y17-20020a056402359100b0045d5cf18d4bsi10751511edc.583.2022.10.18.15.45.37; Tue, 18 Oct 2022 15:46:33 -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=odfFc63x; 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 S230047AbiJRWny (ORCPT + 99 others); Tue, 18 Oct 2022 18:43:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbiJRWnw (ORCPT ); Tue, 18 Oct 2022 18:43:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B65D8B7EEE for ; Tue, 18 Oct 2022 15:43:50 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4AABB6170E for ; Tue, 18 Oct 2022 22:43:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70921C433D6; Tue, 18 Oct 2022 22:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666133029; bh=zhorUzccnj4fCYEMYcILKuGLYfRQ/Z25KahCPnqRaX8=; h=From:To:Cc:Subject:Date:From; b=odfFc63xtigsTnfnTrAALBdlwigpQWcz8ngnG2AVafHF/4N+B7diiuY2FjUUpvK1P V56pTCZFHHYx7RY9GV9Za28j+eNCpn2pdKGnL3X5KC3dNyDrtIXaFx4fn2JUsKk2pb ZNtvVR/WS7SfU1j3KD3+0wNEXj397M8fgULtXLI2tNYNzkZaObxI5gSR9wFRrB1gJj 412rhypn8tVL51Jvihdo9h5yhx0Cq7Lo7Qgh0RKTQafkUBkJ2BOXJ8arVTZSfxYlW9 bQ77ol51g4ZntrM6qC1Mdb+fu5cq9p+k0COmC52VSUp7nuZOnSlhcpaARtjVPRaZdO BCz3hf8l+wmOA== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/3] NFSv4.2: Clear FATTR4_WORD2_SECURITY_LABEL when done decoding Date: Tue, 18 Oct 2022 18:37:21 -0400 Message-Id: <20221018223723.21242-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