Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp626713pxx; Wed, 28 Oct 2020 12:45:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2I9y2+UIFIJ38CCyxwqUFC0IsK7iwVOHynJX5yi4BuwIJ0obTE3HFbt+jxayvhLsV8FIz X-Received: by 2002:a17:906:b043:: with SMTP id bj3mr693032ejb.338.1603914342345; Wed, 28 Oct 2020 12:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603914342; cv=none; d=google.com; s=arc-20160816; b=dOE6MqhSeJDDVjzNl3CktIUe6ZvpnWVYBXSwE4Ln04XIDjZmF3khfblqBlvlf4iiTw MwsXtJbLxUQ7lnFOSVF1JZhNvX8g/FswfgK30B+HiO8a9UwBc684yM/6npIWYB4swsgD At0TqqjjtFX8U2yziRhi4GVYjj7Aj4awqwjqg92IFn003Qd/ybZIiOkni724+u0/U+dv 1hSpigPStg3pMmfxVEYY4jPKJcH4lWJo+2KahyVUNYZGzSa9wOs3cubhsmx96Vl7G2OS 5XJ5wZIOHBWHjvKjr9m24IlIg3V0XqmfWNzAdWtn7yru1ZmR9O8lOeNnPAgIrWMnIi6G 5JKA== 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=10pdE3iJ7NezqeS3E1KcVapQ9lU/wbrz0Sn0eWtbIa0=; b=CkQfwXRe1GuLu2MKSgg8fXNKoQgy1IitGCmid/y4EXY3pHciTiJywGLDMiOYZ68c7C 4htvvwiXtMaD0PaIK21KmJAcDgwaT7vJgXJ9C29p+TGAlJSwXbCc986RdPWfp/KgCqAQ TINBo5atK3MU53UjH4qO9wnmEjtpdhiDPNN0UzZmeuQavcvXGUleXHUruMEElsdbIVC9 RBk8lbVH7znE9lnA3MpaCHtZ/GPoIMtkrv9CpfGw38JfErNzfS89LZN98u6oeYU+tLPM AEhA28ENin9XSGNL3EfOb7sv0s3bmYcoR4jx8jOCwlv1+neEXG9bMPuP5rHVVXMzTauZ LMwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ImD6iOkN; 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 co4si129868edb.461.2020.10.28.12.45.20; Wed, 28 Oct 2020 12:45:42 -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=ImD6iOkN; 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 S1827798AbgJ0S2G (ORCPT + 99 others); Tue, 27 Oct 2020 14:28:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:44348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752888AbgJ0N5a (ORCPT ); Tue, 27 Oct 2020 09:57:30 -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 142012068D; Tue, 27 Oct 2020 13:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807050; bh=XMYfXOnhUsoMS3CYycBbIZEScuV4Ri3RvewhXglCiXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ImD6iOkNzZrgZo2pKuAeJuABOt1JvRSjH9BYjDQQweNlqUWiGKoKFafAsN8Ccwo6S xXDmrSOPa8OXl+N78doPpf4ZeBHtJS5zewMv9r0M+S5jnzIk1RhHn02fpxoUThpZ7z 1FRJdfUiXfVCvKhJtL6ol5qJ7RTIJFhUIaSGioOY= 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.4 024/112] crypto: omap-sham - fix digcnt register handling with export/import Date: Tue, 27 Oct 2020 14:48:54 +0100 Message-Id: <20201027134901.711824913@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 48adb2a0903e5..7e9a44cee4250 100644 --- a/drivers/crypto/omap-sham.c +++ b/drivers/crypto/omap-sham.c @@ -453,6 +453,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