Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1490151pxy; Thu, 29 Apr 2021 08:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweZnNeJ+7PkzTrka7WLPQzEImDSzeWO6yZYZnjI9ScxWJPCopc5qi83jwhbaALU+TBhnlX X-Received: by 2002:a63:7f41:: with SMTP id p1mr166989pgn.208.1619708896879; Thu, 29 Apr 2021 08:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619708896; cv=none; d=google.com; s=arc-20160816; b=MMVw02vnmWUiOX7mSOqW6RHTLZTE1aFcoBG5M9LjIbT4s1jqRWhxAOjED5kAaOQPtW RcMvH/Xcdhj0ETJt7ZChtJT4MzstntalDgdAl2i8TDPkRhRJQkTTnk8lY+AP4xFkcBkx /Gk7c4D5NtJduIj/CH5apyvgXz58MhNx68tWkb/eUxcChyk6mojp6xEY67mnCpfvWHG9 rTGChsaJ1s4Fka6JftbxdkZAfbix7aHvTKu2rzlP3lrLyF4mX9OEwGIbW6+YPqCQpKr2 41EiDDgze840PzWelgVB6IatwS908Xpxg+E7zncuJwx7AXECVlet17MtEL69KBi0jG/G ZnTA== 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=FUSrZlERR89hZzHNyP4QRMbV2CihmITrCmz3k1LlYk4=; b=cHy0KaeEEl1RG+9KYpeAI6+dpSe+4OwmGsHF8oTa+MlwFGVBt928uMTeumDeNJsK/g DEm4SZ5Hh49Urd3YEcolrnE6WI/tIpVc9b9RchSPblzRnKme8TOBku0lA6Wcbf2SFKjr nHK57s7302z3LRsJ7DnR6g0eV2WQKIDwifPJxAuPiXTbpck1BdIXv4pukcvp4hRZzKGd TiW8syCi/AHpQIUnHPvxeZu2kw9fI0DilVZHhbw6vZybsYrgH6GFRNH0bNu6dAx7bIgf 63rNO3ReA2Kf5rkKoyOReoEvo9oL2+aDFXr1OD8u15lZMlAZ0MF63XwQOxLBZNpDQlhb QzjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MHnQJNbV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si3799204pfl.136.2021.04.29.08.08.03; Thu, 29 Apr 2021 08:08:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@linaro.org header.s=google header.b=MHnQJNbV; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240690AbhD2PID (ORCPT + 99 others); Thu, 29 Apr 2021 11:08:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240632AbhD2PH7 (ORCPT ); Thu, 29 Apr 2021 11:07:59 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C689C061342 for ; Thu, 29 Apr 2021 08:07:11 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id o1so7738274qta.1 for ; Thu, 29 Apr 2021 08:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FUSrZlERR89hZzHNyP4QRMbV2CihmITrCmz3k1LlYk4=; b=MHnQJNbVziLM0NPBDtmnwCmOJ2FoMf3Ip14Lec6yiW9Uw6wXJuecmb+TjAI0QTEitc WNpma+n25xPeN4F8PqiRZsQ6R4aIVkCH8d6gs9+6AfMPjY8703EY42h09Hbts2W5+UaI 7bSZMJ1iZtva1r4TQEM9PtgSONILCgKOb5B2IOoR9Q4vGpzBW04aewKE2JlYZG1wp/Q8 IBVIhhlfHUPc+UsCWZMk2wz3B+9/8qML3QPrJzw2tvPHDQ8XFUWsMVUqYSqeFE6ztPPt nM80jMCXcIZ/xuB/Q6/o3HFuQBnSqLdiOHnlJTv+/Q5Goxb65N+HCS6tj7RP2wi/KOl9 LU6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FUSrZlERR89hZzHNyP4QRMbV2CihmITrCmz3k1LlYk4=; b=G9J9q5Tok5/IeX6KChsmZ5Z/pST7WmmFRfBHGKe1ibwJmpfwFz7uhjS6pOuruJtVm7 dcbIuXtCoPd4fByWakkDA/zikt1BAQAeWVGlmaBoe4w3DVmzYPhTd9t2yAgNU9clGFrW AwWjtXPdNqRhtCBk3GfLU1PhMdMeN3e/WpqMsTDqAEhGsCkuYM53QyQ75Gvd0zHcOec/ NBNbmANdPDUa1Bx+6suL6X1tX+yW9JdwhB0O1vm2FhGyfTGz7vVC6TOSMPUCnI55xklN y30YqZT9aRVWuWgNjosO7vS3zwGLTYqBBjI6SlNDVwLwqH/sN/kx/Oi2ZKiCogn2KRLm daqA== X-Gm-Message-State: AOAM530g8JbHKqypT/Kx1Ju1BoHCaDk+rNa5YBUowGPVpLclWtjQKlbL BpROiTzyx9maCz53qKrmUxiA9w== X-Received: by 2002:ac8:7344:: with SMTP id q4mr22981494qtp.278.1619708829856; Thu, 29 Apr 2021 08:07:09 -0700 (PDT) Received: from pop-os.fios-router.home (pool-71-163-245-5.washdc.fios.verizon.net. [71.163.245.5]) by smtp.googlemail.com with ESMTPSA id j191sm2223822qke.131.2021.04.29.08.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Apr 2021 08:07:09 -0700 (PDT) From: Thara Gopinath To: herbert@gondor.apana.org.au, davem@davemloft.net, bjorn.andersson@linaro.org Cc: ebiggers@google.com, ardb@kernel.org, sivaprak@codeaurora.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [Patch v4 1/7] crypto: qce: common: Add MAC failed error checking Date: Thu, 29 Apr 2021 11:07:01 -0400 Message-Id: <20210429150707.3168383-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210429150707.3168383-1-thara.gopinath@linaro.org> References: <20210429150707.3168383-1-thara.gopinath@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org MAC_FAILED gets set in the status register if authenthication fails for ccm algorithms(during decryption). Add support to catch and flag this error. Reviewed-by: Bjorn Andersson Signed-off-by: Thara Gopinath --- v1->v2: - Split the error checking for -ENXIO and -EBADMSG into if-else clause so that the code is more readable as per Bjorn's review comment. drivers/crypto/qce/common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/crypto/qce/common.c b/drivers/crypto/qce/common.c index dceb9579d87a..dd76175d5c62 100644 --- a/drivers/crypto/qce/common.c +++ b/drivers/crypto/qce/common.c @@ -419,6 +419,8 @@ int qce_check_status(struct qce_device *qce, u32 *status) */ if (*status & STATUS_ERRORS || !(*status & BIT(OPERATION_DONE_SHIFT))) ret = -ENXIO; + else if (*status & BIT(MAC_FAILED_SHIFT)) + ret = -EBADMSG; return ret; } -- 2.25.1