From patchwork Tue Apr 20 03:35:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 424542 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6d12:0:0:0:0 with SMTP id m18csp3272403ejr; Mon, 19 Apr 2021 20:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq8DsRoHw3vUxOWoAgsSey3nqt9Phe2WMumC+Zlj+UXHJDiCYNjZ9ntK5Do4qoyldZMVse X-Received: by 2002:a17:906:5248:: with SMTP id y8mr24709811ejm.150.1618889776903; Mon, 19 Apr 2021 20:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618889776; cv=none; d=google.com; s=arc-20160816; b=Xq7REU0o2J03YwxsBX37nadvnhLrau0N2jkQ5O4vdmbNsou2c1uyxQnIolXpOT0w6Z gnqe6wnlICt3N1ba53ZJCf2zy1vb5sMW3U7EljYX/HOwNurXWquaICm2RCdCNlPv93fB kKWSES7dy3yoCUQaLGeJMomO4LLZcEBNBbt9kwfAcu4XlTVPYRQfCIc3JQB6d4cahFxu jXRDeGTW/3xYm32OLv2n7bvyvvu0Yk4XhXLTeBYHknv8hPwB+zB+vwPgGEwEaVGpw0J6 seQFSZ+mDqcBvQpgWsz4pfj1y9KKDgilZjkAREH2ok7HkNbuMjQ6C9jNlFgh8vzQ9VOR KQ9w== 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=PpxsWTMUPhvJqNuN3URDBHOJ7rCHZb9OpnL++8DkbfJbA5xhKhdQtLuFeDDrR36sta evnUdthH6wMObbTSuPmPUSnx3jOH4DiKy+qkn5QgfPDfArbx/UnHfMMUpYpX5N+TO0RN gD5kwB6+dKg8Ry2K0NivmIKjDZB/skRRlwSy2BdUynTpcZOZsrFtGiQO8Z4Iv1iMTo3L 1SiyVu75kDcGQwRPpBuFrOk+xhfKZ3VZhFhVzIVQ7yOtMdQYC6HUjoQ8fX9oHzROqvNE qdAWZH8TqBmSVyXwkbI8hzOEBRnQ4H2Gh1apTCWNYWwI9y2LSEXRqbAJZybuDwM/TXoi 5UwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JKfUHhwo; 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 q19si13939060ejd.250.2021.04.19.20.36.16; Mon, 19 Apr 2021 20:36: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=JKfUHhwo; 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 S229701AbhDTDgg (ORCPT + 3 others); Mon, 19 Apr 2021 23:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhDTDgf (ORCPT ); Mon, 19 Apr 2021 23:36:35 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00C1AC06138A for ; Mon, 19 Apr 2021 20:36:05 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id z25so5064734qtn.8 for ; Mon, 19 Apr 2021 20:36:04 -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=JKfUHhwohTAlIErOZ5oVcBUy/U3OOTDr2G7VEB2UxHxsSijfkzoHaIRv30O3iTSSgb IAAQIpxOUIL8Cj1R5RBtffr7tOw83iHNxZnF1N5xredPDOrc/+cqC85bswlh8q+EySk7 8dwWPjm06xrtLktshNebkbjlV07CloyqAOPlpB42aVCMZXTOrxeunMYJMRRqi3CFCT5c HdmyoO8W/86tk2pYta/3XmrfNJNgJ5MqnoZXP9Ii3z0qkteGfg9l7Tt15GMHGBbIuww+ Y8v8HAh9UE9wiPuayC68mvhuvfJC8L/xg5wof7AjZO7SsUenw3LyWh/RttBVZcyPKiMZ YpvA== 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=Tv2JxJeoKxq2jrAJVAJ+YGSuiDNq8tvWW1wmF+M0CR5EM8UFGkByi+3Dyv0MPdMf3Z ayq/iWnD4nek2hCcwsfZDLmZC+jg44/rnOJI6o1996s5PIpG+s7uQ1iShHoviY59c3+z Yz7jVaCtys28UANDzRtAYlW/OW23j7/OgxQB34DZNb+G5e7A04v8z2xbR4hq3w/v4hVk Q6y29NjJRf22apGIjbAw89UAK/tcBHOEpFrM0+pII+NLrq0F8jaGSLEvrrXW6+ZFfB9J ZQ73BYKSjhMDPQCWVEgs2SjsFNJPM4tbjTuMaGPO+C9TNYmwUJZcsjDPHsEruyqAx7mC 6kbw== X-Gm-Message-State: AOAM530PldEQcav7a3neujreHMV1CIyi49dgnTomdl0RdlTTwiYeCnqC ALnNQzAH00bhm0EwtRKbv+PSWqd4txcKYw== X-Received: by 2002:a05:622a:13cb:: with SMTP id p11mr14753149qtk.349.1618889764259; Mon, 19 Apr 2021 20:36:04 -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 b8sm3562643qka.117.2021.04.19.20.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Apr 2021 20:36:03 -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 v3 1/7] crypto: qce: common: Add MAC failed error checking Date: Mon, 19 Apr 2021 23:35:56 -0400 Message-Id: <20210420033602.1729947-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210420033602.1729947-1-thara.gopinath@linaro.org> References: <20210420033602.1729947-1-thara.gopinath@linaro.org> MIME-Version: 1.0 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(+) -- 2.25.1 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; }