Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1091399pxb; Sat, 17 Apr 2021 06:25:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYhSKjfKu+xJYM8Y5GGjGZTSrRcgdAH7HzWZJhiPNGVfNtkvdH/F2N+d9A1MjEUZL6nwi6 X-Received: by 2002:a17:90a:bf17:: with SMTP id c23mr15103516pjs.12.1618665935819; Sat, 17 Apr 2021 06:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618665935; cv=none; d=google.com; s=arc-20160816; b=RQv/E6LcL/CA4XUCkR9nVs5Q9xZpGFH/dJi02/i2o9wejNZ7bHOCesM3geSUdbY/AM hF96sQe2PifKr4YY7LDxHgMkbNbehitavAyLF2Z1BPlHdlnFUYTJj8P9T+bCivQZhWtQ chnxeGYgKexlS49kOD0QuRyhDezKF+143NCYKp5k2BfRUNJYGTjrhcREtlF0oVnXdIOx NdgJQSHgjjqyGibxC9pVUWwKjn6qFxfB9cXkKK8Y1bLWus3z470C4L+CHeXDdAEkyEHu 5yOJcG895/dgJBpvpRpTSIT2SwK739h1pl2+bnJDZUcZl0VWqVkrZPIkQbfoh0mmy5LZ TdAQ== 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=VcMAQ1EGbeesv8V+7yaxgvD6ypjuKCvSWavQ5LbGTMA=; b=gbHl08AB1t/QW2ZDZ+ESPs6qP7txyGDd1iC1MKAxuxjDPErLhl+I5kLUCDxMLXmaQY rR9Vyj7/BxmSd63sKw9kAao+tTkKeFiwoh4WT7cwdOXVdxPWh5eVsh9cxCyzD/SQgIDq +p+PKlIgJNJeusO6gYo+vjrsRDw3algGnMNblYAr74fWxiR1WAYpq+88wG8PFS802n95 Z7tVok50JNbd+2wepto5IKEj3nDB0C/4bdAnBxfllZ92NwszTQ/zbePKUZoWR2qtG0Lf c7D4Sg32XYxs+CdWrq0O+n8IPGmFUwtNlK3PH0dCVHOZ4p64L9ed/JJBhlfdWBi+gWk+ +u9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HJklx3Nm; 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 t75si10378798pfc.174.2021.04.17.06.25.20; Sat, 17 Apr 2021 06:25:35 -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=HJklx3Nm; 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 S236378AbhDQNZi (ORCPT + 99 others); Sat, 17 Apr 2021 09:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236305AbhDQNZc (ORCPT ); Sat, 17 Apr 2021 09:25:32 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22D73C06175F for ; Sat, 17 Apr 2021 06:25:06 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id z15so14813668qtj.7 for ; Sat, 17 Apr 2021 06:25:06 -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=VcMAQ1EGbeesv8V+7yaxgvD6ypjuKCvSWavQ5LbGTMA=; b=HJklx3NmN3v5pM8kGfdNbm5n0eFqnc10Glfghb83pTbDpCrMYdPfZz4u4Bv2vHH83U VMDX1shkqN4rrDBBmHtap2Cqyv2nTXbd4Lg5fEBujY+6YExQHpoEFXtc1z6FA2rsd5js BQEjaQLOfkVpRyt5/v5p+yWUCgSw575N9FmQ5BtsB1qxb3rQHn8zvh4UUWTfTLUoGbz6 itIj34CECkk0qnPmcoYGn8dnrxxXauKMaJ3wu0SY9OYlqKmWCIf3U54S13EIDvtDsjUL /5bof0+dO8U3AAsui0BDUKVVXdANhKngxPfGKPOcPO0I8iqTXHRAwHMdTS43BeF4uvgm b5cA== 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=VcMAQ1EGbeesv8V+7yaxgvD6ypjuKCvSWavQ5LbGTMA=; b=lvF33HGFYle9GFdqygE0tsh/AkJm1WJ4Bdn5+PqiaguyDyv0OZJ38opay0y8USwK1g gBE7EqPL81cBbYUAE4J7jJV739YeRmYXdIJxPg6SxleC5c0+D8r6iP6ect7SUNIq6OUA nWRRQQTLS0gXxjZ3OEHf3h6a3FCQjrEu2e+XCaNmKqSEYLd2QF7B7YagoQ8722hPvYnT Wv3Re+3BE2yN6MkWH4vUTrQzP7Ln0sc5AbeoPqInWN0VN4Q9MWu0kpJzG5+sYVuimBjq q1yraTx+qu/eN7C5+Pf4ZWek//aGOEkNPAnGqJhVy/+bVDKe2cd2UoGuYnCACTmZ+t6S KunQ== X-Gm-Message-State: AOAM531QAe3UVjb47Pxy1x6JhioBiVU7dTMtPRcVgtvraj9SuK0pnpDb 5J43ji4uq9Fgu2YyCG1wWF1inA== X-Received: by 2002:ac8:4411:: with SMTP id j17mr3793443qtn.109.1618665905302; Sat, 17 Apr 2021 06:25:05 -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 o25sm1988327qtl.37.2021.04.17.06.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Apr 2021 06:25:04 -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 v2 1/7] crypto: qce: common: Add MAC failed error checking Date: Sat, 17 Apr 2021 09:24:57 -0400 Message-Id: <20210417132503.1401128-2-thara.gopinath@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210417132503.1401128-1-thara.gopinath@linaro.org> References: <20210417132503.1401128-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. 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