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-next>] [day] [month] [year] [list]
Message-ID: <20200620230756.6592-1-song.bao.hua@hisilicon.com>
Date:   Sun, 21 Jun 2020 11:07:56 +1200
From:   Barry Song <song.bao.hua@...ilicon.com>
To:     <herbert@...dor.apana.org.au>, <davem@...emloft.net>
CC:     <linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <linuxarm@...wei.com>, Barry Song <song.bao.hua@...ilicon.com>
Subject: [PATCH] crypto: scompress - call the completion callback for the completed acomp_req

While using acomp_req, users may customize a completion callback, if the
backend of acomp is actually scomp, this callback will never be called.
This looks a bit messy to users. For one user, all scomp details should
be hidden by acomp APIs.

But it won't cause any real problem if users simply use crypto_req_done()
as the callback, and further use crypto_wait_req() to wait for request to
be done since crypto_wait_req() depends on the callback only if queuing
acomp_req returns -EINPROGRESS or -EBUSY.

This patch will make sure the customized completion callback is called
for the first case. And it won't break the second case in which users
use the common crypto_req_done() and crypto_wait_req() only.

Signed-off-by: Barry Song <song.bao.hua@...ilicon.com>
---
 crypto/scompress.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/crypto/scompress.c b/crypto/scompress.c
index 738f4f8f0f41..634b7ced9348 100644
--- a/crypto/scompress.c
+++ b/crypto/scompress.c
@@ -158,6 +158,10 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
 	}
 out:
 	spin_unlock(&scratch->lock);
+
+	if (req->base.complete)
+		acomp_request_complete(req, ret);
+
 	return ret;
 }
 
-- 
2.27.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ