Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2626762pxa; Mon, 17 Aug 2020 14:48:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhjNWaDQ/MbUN8X9M2B91VPGGtZwgcnEbRs5oxKIn8ESeqjJSeO64HTKjJ+whmcMAGAGIr X-Received: by 2002:a50:d809:: with SMTP id o9mr16288010edj.12.1597700901797; Mon, 17 Aug 2020 14:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597700901; cv=none; d=google.com; s=arc-20160816; b=fFJtR74UcAQHKslrcOyPE03/2G8nsc5ev/YfG2MPPlLiB+6JqaDYT0bpGSqqOLMNQl r6H3cuN0bK9DhJFwJ7hd4NQHfwvdOc7/gF1U+G769daVQGE1evFeJlGB0ZokdFYZSqtM 5yjmuuIaWwE5VAwkZlHjWrOHfWpGUODh/jUrDvXkZSbS6Umz2YEmLQqFgAolqI0i/Nuj 1PtnWB1bgdekKplnFCVySQ16NWgbknC3aR17xeVqPPz9LiMVLN6s4TCN02RfqYu+tsA0 klVeF2klG7SPd9i3NHeGVeImwaYMrHfTBRkicZgIFtsK1a3QmNgWa6zCkhXXgRIFk3cV azjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TstUnHs5xofwIHlfLfvuLqS9yFFB7D9VdaWp/gbaoOc=; b=CAR+V1Qaw5wh1Voyi9NuZfpwWz+CEB8Ild7eTHrwkAkDzboJLES1SFiV/+nJS3eLY9 NLvbHXl3rOEGZyBSxkT7/FmTpEjmQu99vHUyOX96TUvJSW6eJLjrfZ5J55LLPP0ONZOy v6UGchj5+GK1/a6dr1v56uTisjCSRHkV4sdidFDHdAdXPPJdSDAtpjZ5XDXXPyaGx2un +sxr05Cr3ja1JunMXS5f+IXz/8TBAJ6qIonUewVEh4aWUo2TD11bAle8Dp8L+RxTPree SVevWLFN2g76Ob/hdOgpuDtS94Rl2hdfNMRSs0HonWgX7hVI0Y2aq2oOpFfzu2eOkLPu a34w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DNOkeVbf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si12225767edh.154.2020.08.17.14.47.58; Mon, 17 Aug 2020 14:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DNOkeVbf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729788AbgHQP0H (ORCPT + 99 others); Mon, 17 Aug 2020 11:26:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729652AbgHQPYc (ORCPT ); Mon, 17 Aug 2020 11:24:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 046FE20729; Mon, 17 Aug 2020 15:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677871; bh=2K2iG1CjBSTPdSLSG5ajTMC50p1FwenSlUrZitpjRWY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNOkeVbfE7zS/RfMHyQpKfMAMZFHg64HsPI45AjP5tgMLGKD3tXCjjwuAi0HcyFk8 pO+lkPV8lvB3Mir5hF2k9lGjCDKqX6nSStltRUU3M0YtLbz8gDOjU/lp7m9n2YYUuQ YVIq+z2nD7096yhk8a7lsnscAv2xlpfMNJ4DRmJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Horia=20Geant=C4=83?= , Herbert Xu , Sasha Levin Subject: [PATCH 5.8 138/464] crypto: caam - silence .setkey in case of bad key length Date: Mon, 17 Aug 2020 17:11:31 +0200 Message-Id: <20200817143840.426266943@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Horia Geantă [ Upstream commit da6a66853a381864f4b040832cf11f0dbba0a097 ] In case of bad key length, driver emits "key size mismatch" messages, but only for xts(aes) algorithms. Reduce verbosity by making them visible only when debugging. This way crypto fuzz testing log cleans up a bit. Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/caam/caamalg.c | 2 +- drivers/crypto/caam/caamalg_qi.c | 2 +- drivers/crypto/caam/caamalg_qi2.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index b2f9882bc010f..bf90a4fcabd1f 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -838,7 +838,7 @@ static int xts_skcipher_setkey(struct crypto_skcipher *skcipher, const u8 *key, u32 *desc; if (keylen != 2 * AES_MIN_KEY_SIZE && keylen != 2 * AES_MAX_KEY_SIZE) { - dev_err(jrdev, "key size mismatch\n"); + dev_dbg(jrdev, "key size mismatch\n"); return -EINVAL; } diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c index 27e36bdf6163b..315d53499ce85 100644 --- a/drivers/crypto/caam/caamalg_qi.c +++ b/drivers/crypto/caam/caamalg_qi.c @@ -728,7 +728,7 @@ static int xts_skcipher_setkey(struct crypto_skcipher *skcipher, const u8 *key, int ret = 0; if (keylen != 2 * AES_MIN_KEY_SIZE && keylen != 2 * AES_MAX_KEY_SIZE) { - dev_err(jrdev, "key size mismatch\n"); + dev_dbg(jrdev, "key size mismatch\n"); return -EINVAL; } diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c index 28669cbecf77c..e1b6bc6ef091b 100644 --- a/drivers/crypto/caam/caamalg_qi2.c +++ b/drivers/crypto/caam/caamalg_qi2.c @@ -1058,7 +1058,7 @@ static int xts_skcipher_setkey(struct crypto_skcipher *skcipher, const u8 *key, u32 *desc; if (keylen != 2 * AES_MIN_KEY_SIZE && keylen != 2 * AES_MAX_KEY_SIZE) { - dev_err(dev, "key size mismatch\n"); + dev_dbg(dev, "key size mismatch\n"); return -EINVAL; } -- 2.25.1