Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp601893pxx; Wed, 28 Oct 2020 12:08:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYb0kWMBG1z+bMtoKIecoZhR1+x8kE6Wa2YLsIX2bRWlJd9TwFC2nnANUx/0CzqymjgkGy X-Received: by 2002:a50:d587:: with SMTP id v7mr400694edi.38.1603912099945; Wed, 28 Oct 2020 12:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603912099; cv=none; d=google.com; s=arc-20160816; b=rT0cyzmZ9wEWlMdLnvCs0XSSh1UjvlvwtLqncuIXXd1YiJR1hboi/+FTePAZb9shAC agLgxD4gfq5MSXFFtd0yeOqmi5mqQ93hjwkJwp5NmhaevfTEAQGbP+mDQmPuQfi/qVW9 5e7EM2v0KSNaCmwYHRAFpe5i2WZ1sRBtb/OEy5CgYZIQAXP5CRT4iVv0AgddjVivFPn8 Hxns5gYSa80vntzLgfsYCFFmn50a6AISnMgrj4xAvVQs7IugvyEovIUISLA+y5cxvVaK Gec/Y8DBIQB6ApeH0kd1J1Yzn5sW10HeRV79d9lQkfkNImTpyEmzEioqWbVyLC89XL0S Dtcg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Sq9JKdnjcUcVWA4zWrADhqDpUyuNDVEzgKLhTwZG5KQ=; b=gC3vefp26ZlbnU+czr2RX9ZTvj5oPhcJn2ilApuprPDCPHs9eQ0AghMzye8fP2Bn9K ZNeKcJ76ZTLJbaiK98+OvclPfIAQs0KmfuCZSvQ5dOYUxAf3qY2K/YROzKytRnQFxWxO 4i6x/ST2XU34+h/FBC2ZIYfFJqx1xUqd9QzrzCcPs10V+aXE3lxdHDz/8KO20JtFSK+g 6z6UruXj++psDyMbEWnpbY9bOYZqagE9Kgr/onFdcSPIF5axEeu8r9pnFvfpwHQf8Wiu s7r4VDzw5HChQ04qiYB9U806rQRIHio0XDQGFh9kyBjzkSWA/FButDCUDllVQkdSxIpt wCeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oCP5k4a+; 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 m26si11386edq.372.2020.10.28.12.07.57; Wed, 28 Oct 2020 12:08:19 -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=oCP5k4a+; 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 S1826266AbgJ0SSP (ORCPT + 99 others); Tue, 27 Oct 2020 14:18:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:60598 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2507075AbgJ0OLS (ORCPT ); Tue, 27 Oct 2020 10:11:18 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 B4D932072D; Tue, 27 Oct 2020 14:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807878; bh=cRytgWqLrhFE6pznWwfSZyBeMHf6FBR2VtKOn7dD6SA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oCP5k4a+1hvJB18jT6ox3Yim91PRM+Hi5v9fYDhfAKBAl9Pi+Q5Hn+a5GVPmk9/MU ey7T9tFKX+mkKUTuNZLXv4DIt0fa9gY2TB9QU95uli4Kl8cPXvYN3jYXOc0t34qKPg dLFdgTjCa7xz4ZqdTpELGNWv02G/U7E8Mqsd48vE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tero Kristo , Herbert Xu , Sasha Levin Subject: [PATCH 4.14 033/191] crypto: omap-sham - fix digcnt register handling with export/import Date: Tue, 27 Oct 2020 14:48:08 +0100 Message-Id: <20201027134911.331423322@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tero Kristo [ Upstream commit 3faf757bad75f3fc1b2736f0431e295a073a7423 ] Running export/import for hashes in peculiar order (mostly done by openssl) can mess up the internal book keeping of the OMAP SHA core. Fix by forcibly writing the correct DIGCNT back to hardware. This issue was noticed while transitioning to openssl 1.1 support. Fixes: 0d373d603202 ("crypto: omap-sham - Add OMAP4/AM33XX SHAM Support") Signed-off-by: Tero Kristo Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/omap-sham.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c index 4e38b87c32284..e34e9561e77d6 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -455,6 +455,9 @@ static void omap_sham_write_ctrl_omap4(struct omap_sham_dev *dd, size_t length, struct omap_sham_reqctx *ctx = ahash_request_ctx(dd->req); u32 val, mask; + if (likely(ctx->digcnt)) + omap_sham_write(dd, SHA_REG_DIGCNT(dd), ctx->digcnt); + /* * Setting ALGO_CONST only for the first iteration and * CLOSE_HASH only for the last one. Note that flags mode bits -- 2.25.1