From patchwork Sat Apr 17 13:24:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thara Gopinath X-Patchwork-Id: 423411 Delivered-To: patch@linaro.org Received: by 2002:a02:6a6f:0:0:0:0:0 with SMTP id m47csp1228909jaf; Sat, 17 Apr 2021 06:25:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz91E7/uuH2v+IO7BFHAzfxYI/jYSWnrJlvvUgKbtwAP6XWKotdPMAzl7b4k1TH26jB9uoF X-Received: by 2002:a17:906:840a:: with SMTP id n10mr8641992ejx.59.1618665911640; Sat, 17 Apr 2021 06:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618665911; cv=none; d=google.com; s=arc-20160816; b=O6hcGDG5s5wOwuOT+XsuSVO2vtW372ZJIWWzzFMASuaFG7gkxfWRWNzQ5BxE0AJkqj zr1XnqXQFAIIZ/+HrFHXnYXP5irhTRF/ZqWZ3RW3ecHC83XA9rc0pY1gsrCcecFXMhb8 vDeJlSt7Rg420bNEbBYF440zn/n11hKp4AzHXqqaXKRwHJDXn7raeD6t6Fqz2mSTdMgd BQ0K3JipHJc1xVcQFLpNym0xZ1kYaJxQnSwm2gqg05QL4yIwX7cXpELzv9T//tSJyf3N A6h2b0vpbPzJeS0jK1q98Nfvz3yTGO8wbmcKX6JK8nOC43yAHT263IjNCIamPC1PQcHL nzWg== 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=XbVJigz2bAtC0vCpkGGlD3hsnCLOhZ4NC/veBpGSVGrzFp9Nut88cZv3wH6326QH8a NCa6EZ5I4jbLc7RTarpoegYsDqAduiM9hrebsCZUHLYD3sR7tdL4jI/5xDB8mM4tblqH h+l24Mkqc303XuWpKomiy8GZPEBm6PYjTP55Q5McPAbt+eTVyKpYPMQtK8Q61IPX5LFu 6+FCEGlNX4BWV5LEpH59sSlVGtEG+WlGx8Tl/2YQGCSAjHpT7LN3wG3n9fmJ3TIn7dAY Lmx3QC1lAdzb1qTQVDUZT/k7ut/+VYAUvcINRfTkThp/yieR4MRTivUMp9TyI4GkteXM lqpw== 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-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 h2si7277080ede.520.2021.04.17.06.25.11; Sat, 17 Apr 2021 06:25:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-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-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S236356AbhDQNZd (ORCPT + 16 others); Sat, 17 Apr 2021 09:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231772AbhDQNZc (ORCPT ); Sat, 17 Apr 2021 09:25:32 -0400 Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B208C061574 for ; Sat, 17 Apr 2021 06:25:06 -0700 (PDT) Received: by mail-qt1-x82b.google.com with SMTP id z25so155513qtn.8 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=DaH/R56kAmIq+39IhVX4fnzHPE/8DSoQPIUFiZl0j9MMy1YWdXE6lXwIWn9JLQCLL7 7KJJprE0NuxW1uUP7umsBs526kzU4jMaoY/qzn1io6vmTDHXM56GHuRIZYKJ6xm/X5VE i2VwcOoe7uz1IQ0wbMhQmzg5mvvIOxUJKds1NLnoo2itBevO8k7A+A7PJixUX5tlyYcR 5Y0lC0w2V/yE0VDCboDQC+FjgQ7jVLhyBmd6uwSIKuLF7bIPqx+nEKPHxkTSBW0MIlnW +roS+LYggw63uGe3tpLimYB1oyO5b091KYScUZWD/HTeWiMchn/9vhrUCxU8FQ736NQf 3UZQ== X-Gm-Message-State: AOAM533ggpmKysbOh5u3u77emiS+HIbVK1Ag28mBPri2EZWnby77IlSk 5fwLRzr015faOWlqynCexbDoPmHvMUmn5g== 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(+) -- 2.25.1 Reviewed-by: Bjorn Andersson 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; }