lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000b01d91f4b$509b3ee0$f1d1bca0$@foss.st.com>
Date:   Tue, 3 Jan 2023 09:13:44 +0100
From:   <lionel.debieve@...s.st.com>
To:     'Linus Walleij' <linus.walleij@...aro.org>,
        'Herbert Xu' <herbert@...dor.apana.org.au>,
        "'David S. Miller'" <davem@...emloft.net>,
        'Rob Herring' <robh+dt@...nel.org>,
        'Krzysztof Kozlowski' <krzysztof.kozlowski+dt@...aro.org>,
        'Maxime Coquelin' <mcoquelin.stm32@...il.com>,
        'Alexandre Torgue' <alexandre.torgue@...s.st.com>
CC:     <linux-crypto@...r.kernel.org>, <devicetree@...r.kernel.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 3/7] crypto: stm32/hash: Use existing busy poll function

Acked-by: Lionel Debieve <lionel.debieve@...s.st.com>


ST Restricted

-----Original Message-----
From: Linus Walleij <linus.walleij@...aro.org> 
Sent: Wednesday, December 28, 2022 12:04 AM
To: Herbert Xu <herbert@...dor.apana.org.au>; David S. Miller <davem@...emloft.net>; Rob Herring <robh+dt@...nel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>; Maxime Coquelin <mcoquelin.stm32@...il.com>; Alexandre Torgue <alexandre.torgue@...s.st.com>; Lionel Debieve <lionel.debieve@...s.st.com>
Cc: linux-crypto@...r.kernel.org; devicetree@...r.kernel.org; linux-stm32@...md-mailman.stormreply.com; linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org; Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH 3/7] crypto: stm32/hash: Use existing busy poll function

When exporting state we are waiting indefinitely in the same was as the ordinary stm32_hash_wait_busy() poll-for-completion function but without a timeout, which means we could hang in an eternal loop. Fix this by waiting for completion like the rest of the code.

Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
---
 drivers/crypto/stm32/stm32-hash.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index 0473ced7b4ea..cc0a4e413a82 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -960,11 +960,13 @@ static int stm32_hash_export(struct ahash_request *req, void *out)
 	struct stm32_hash_dev *hdev = stm32_hash_find_dev(ctx);
 	u32 *preg;
 	unsigned int i;
+	int ret;
 
 	pm_runtime_get_sync(hdev->dev);
 
-	while ((stm32_hash_read(hdev, HASH_SR) & HASH_SR_BUSY))
-		cpu_relax();
+	ret = stm32_hash_wait_busy(hdev);
+	if (ret)
+		return ret;
 
 	rctx->hw_context = kmalloc_array(3 + HASH_CSR_REGISTER_NUMBER,
 					 sizeof(u32),

--
2.38.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ