aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/crypto
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2025-05-01 20:37:30 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2025-05-05 18:20:45 +0800
commit0efae411280988b43d5e5042aa047eeb276d1dac (patch)
tree5453ea0045c8e361ea5f15070782f9f9fd86e54a /crypto
parenthwrng: rockchip - add support for RK3576's RNG (diff)
downloadwireguard-linux-0efae411280988b43d5e5042aa047eeb276d1dac.tar.xz
wireguard-linux-0efae411280988b43d5e5042aa047eeb276d1dac.zip
crypto: acomp - Clone folios properly
The folios contain references to the request itself so they must be setup again in the cloned request. Fixes: 5f3437e9c89e ("crypto: acomp - Simplify folio handling") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/acompress.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/acompress.c b/crypto/acompress.c
index 9dea76ed4513..6ecbfc49bfa8 100644
--- a/crypto/acompress.c
+++ b/crypto/acompress.c
@@ -566,5 +566,23 @@ int acomp_walk_virt(struct acomp_walk *__restrict walk,
}
EXPORT_SYMBOL_GPL(acomp_walk_virt);
+struct acomp_req *acomp_request_clone(struct acomp_req *req,
+ size_t total, gfp_t gfp)
+{
+ struct acomp_req *nreq;
+
+ nreq = container_of(crypto_request_clone(&req->base, total, gfp),
+ struct acomp_req, base);
+ if (nreq == req)
+ return req;
+
+ if (req->src == &req->chain.ssg)
+ nreq->src = &nreq->chain.ssg;
+ if (req->dst == &req->chain.dsg)
+ nreq->dst = &nreq->chain.dsg;
+ return nreq;
+}
+EXPORT_SYMBOL_GPL(acomp_request_clone);
+
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Asynchronous compression type");