Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5749198pxb; Mon, 14 Feb 2022 06:48:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJKH9l9ZLhqEtU9MNO5YuxBigIqOkNev/rX+kxnexhOuZeqQdthD5XICqQ4BszECeMiCXH X-Received: by 2002:a17:90b:3c01:: with SMTP id pb1mr8588031pjb.132.1644850111450; Mon, 14 Feb 2022 06:48:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644850111; cv=none; d=google.com; s=arc-20160816; b=Veys2WgACHzw+wpCu6XjSMvF0pLCIh8KxjNwmuUKlxMdbx8onLrp4gOuNP19ugv8G4 OP5ApM1L9IHRjeK4sHHv9DREXF2SNF6mcRrnGk0W4znGMSI0N9k65I2GwlYCsdN1YNpz j5PwnP8DJbYiwRLJ+Aai2spTYma8PbESrYUA+UxfWkRCe7dNHtb/NRKTeHljfWliskxM foXJVNB0yKmgQTMtuuPT3FL3NXPeC4qAqCRsM6i+urhsn6CkVzhZKg63mRmZSGXqbY8a nvQiSbKOR0msdG3gXgA9EEYB1z8gL1ajRq0C8Mvs5V4ijeAM6b+RmB38TzFe15iM4OOC bLeg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=42aQ9TlAbp30zt0ROe+6M6y2c8ScWuM+FeFJuC/j7U0=; b=VOHZlWsGkUpSVh2kqKGk03w4M1u0HzSAk2zHTv+WsgIdPR0lDLwyvM6NY6pdUIBUYs Rm6VbrKuQbMTFltQY84svgnzzM9wKcmgarjlf1oHKnpZ5gkPYTI1afkqaW9NN0+dcyaj 7IKSQqHt2YshxdC0QOgNrOmbEqQt1cJRz5kGDya9dqchQBC8FTzaQPg6Cy+cXYImVyCG yny9DSZPVgoUK3aS1MAPXU8Y4NqRkGMHsailgVcB6IfSTXbRv30H0T1zf9mdOs6D1/Ue pd+2dRjQV1hn5fNLO5xci9C6RLn/FSp+XrNurPyIXAw8oXMNxkFvriZ+gCFfBY34b9TD wKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KSiv7W4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u10si32155706pfk.192.2022.02.14.06.48.10; Mon, 14 Feb 2022 06:48:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=KSiv7W4Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244377AbiBNJj4 (ORCPT + 99 others); Mon, 14 Feb 2022 04:39:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243562AbiBNJhX (ORCPT ); Mon, 14 Feb 2022 04:37:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8431660D86; Mon, 14 Feb 2022 01:35:08 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 9F7CA61163; Mon, 14 Feb 2022 09:35:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 774E5C340F0; Mon, 14 Feb 2022 09:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831305; bh=8tqkdPSe1TX4gYfhZraComcw/+m05OtfO1tnPVdC2rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KSiv7W4Y3oHEwkxYeizkO6QiDkd8TpwO7JWuunaFG/A1+8BKSpoblBCzZB5PXUGOn OzejjohDIY0qjLfSgjcZMLjDe181R7f+mAQWunriaosysZjhaR1n+cykt4AH49ihN8 YD5Dtn3YCOqEYtQS4337drtj9kZiUnsNjH2v0T4U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Olga Kornievskaia , Anna Schumaker , Sasha Levin Subject: [PATCH 5.4 12/71] NFSv4 only print the label when its queried Date: Mon, 14 Feb 2022 10:25:40 +0100 Message-Id: <20220214092452.442678468@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092452.020713240@linuxfoundation.org> References: <20220214092452.020713240@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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-kernel@vger.kernel.org From: Olga Kornievskaia [ Upstream commit 2c52c8376db7160a1dd8a681c61c9258405ef143 ] When the bitmask of the attributes doesn't include the security label, don't bother printing it. Since the label might not be null terminated, adjust the printing format accordingly. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin --- fs/nfs/nfs4xdr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 9a022a4fb9643..0fc08d22c9218 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c @@ -4187,10 +4187,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap, } else printk(KERN_WARNING "%s: label too long (%u)!\n", __func__, len); + if (label && label->label) + dprintk("%s: label=%.*s, len=%d, PI=%d, LFS=%d\n", + __func__, label->len, (char *)label->label, + label->len, label->pi, label->lfs); } - if (label && label->label) - dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__, - (char *)label->label, label->len, label->pi, label->lfs); return status; } -- 2.34.1