Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp161930rwi; Tue, 18 Oct 2022 15:46:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68O7fB5yuXis9WgvEpld+xNTu8F9xrLyKbQGIjZONKzJ24Yz8y6bpv55ze3O+H5Fpsga8e X-Received: by 2002:a05:6402:1941:b0:457:13a:cce9 with SMTP id f1-20020a056402194100b00457013acce9mr4709857edz.265.1666133193581; 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=VerpJO9wpeGLCXGRo5bYrBLjwJ5a4Xynodhsvq6ciPopvWSvcD5AbkQamT4X7F4+k7 h0GNnk5V1G9O6KXfR2NszjEqTI3yDcBprecAEas/r3lHdu4dpDv/2x70yPulPlxbOi2c HQ+f9bhaGbm9pnNB//c77uCYP8v7cpejUZ2tXLE42JzYqYOf7T8DOJVxtJFtwepuMQgd Eq7uBkMSa9Ko+gQGeikn43lbTLfbPJBgE03UfDve+o88u1BHohDju7PVOoo5FBxv049V +2Bq3Uxe1vYhwIjQnmEd+/VIntgGh4h9KbJ6Kr3fAIGz9O60Uu6gMIbKW/JAYaD+U5zj Pcjg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PUQLPW+1sqjjdVJ6D+31PY+aL6uI+NOuLp/++PuzSMQ=; b=fDTYoZ2tRUndPti6AJmkjtp3qknDgw7nmmUD5GCsrnv7MIm4LgEfhyFCfLB03OvufI 2zyOczU2JrhAH2s1oO+5HzZeORaFuyg0YX4I3ITVr2Bctfb7SRBqai0qBlRWbC9DAhYo pUmDyJIM4kN6OXnHtAP3yVUAl7C4EYjLHYHNwpTDqHGIuOU6hClD8TtATrLi1fJt/BLz Hzh95ExQTthN3EtMrlHfx92gMQyu9S2YVbswqZJuiEua0JfY8nFVY0nbE5LsZ69mBVUy oZRX9Tubry5OfeX+Co+C72MLUzmf5UUqPO0iZJNuEBF85Pj+SIaLaFvADraLykxuIPqJ uWNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HRlNCOqq; 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 hv9-20020a17090760c900b0078c31a71f47si12119008ejc.220.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=HRlNCOqq; 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 S230025AbiJRWnx (ORCPT + 99 others); Tue, 18 Oct 2022 18:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230047AbiJRWnw (ORCPT ); Tue, 18 Oct 2022 18:43:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33119D2586 for ; Tue, 18 Oct 2022 15:43:51 -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 C726D61707 for ; Tue, 18 Oct 2022 22:43:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8F23C433C1; 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=1666133030; bh=t2/xg3pT7kkeTRUALvA7eHeItxqCkGEC5tZzOF2LVPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HRlNCOqq6ivJxGM8WQYsLzIAy3Be3WcsACYFvQgQKNXH8FEip5ahTScCHgFQ1zxOq VTvVz9uXID08jYxIxpymgLiMRaWC7m7t2jq6lGYygwD3i3i9Hrt8dlNwGHVQ8MnxLy yCJdzwG8TBmx9TCxzJsvIlG7ITCDHdbW3UvhcL3pazew8e0pZOUXvyTXv0/vS9c6DG /0+dw+ZFjcZ1GiLECv+8oT7Dvh/IpF0EqoKDv8n2/PjKTcPI1i8T253jGaE1OQOXYU 74JR3nCgrzHtfLiSmG7YeayXuQbOx8sO8ouk4Ws4nNYdvjqQiHx2M7iLg71giBxQNA FfWGsQPk96W5Q== From: trondmy@kernel.org To: Anna Schumaker Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/3] NFSv4.2: Always decode the security label Date: Tue, 18 Oct 2022 18:37:22 -0400 Message-Id: <20221018223723.21242-2-trondmy@kernel.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221018223723.21242-1-trondmy@kernel.org> References: <20221018223723.21242-1-trondmy@kernel.org> 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 If the server returns a reply that includes a security label, then we must decode it whether or not we can store the results. Fixes: 1e2f67da8931 ("NFS: Remove the nfs4_label argument from decode_getattr_*() functions") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4xdr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 8c5298e37f0f..9103e022376a 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -4755,12 +4755,10 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, if (status < 0) goto xdr_error; - if (fattr->label) { - status = decode_attr_security_label(xdr, bitmap, fattr->label); - if (status < 0) - goto xdr_error; - fattr->valid |= status; - } + status = decode_attr_security_label(xdr, bitmap, fattr->label); + if (status < 0) + goto xdr_error; + fattr->valid |= status; xdr_error: dprintk("%s: xdr returned %d\n", __func__, -status); -- 2.37.3