mirror of
https://github.com/torvalds/linux.git
synced 2026-09-12 20:53:03 +02:00
This push fixes a memory allocation overrun in crypto acomp.
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEn51F/lCuNhUwmDeSxycdCkmxi6cFAmqRLjEACgkQxycdCkmx i6dErxAApAYijF83H3Lg+dxKoLispqaTjT5yZKXZES19WBViPhuigDoxOA9Ca5EB L5UkSdC3hTKKd5f6DfyHpv44rnUSc178h+DpIaprHFHG3XJcl7pgPi87dNc7RkgD e9rBUi95VcJdT8OfTuGNd5xw/xL4IJA9uOJ93vLZduh8YzN0UzjYioMzIFFhbKNu gl6mGKfqh17DWRc44/WJYtH0Yu9wEQ06d1mXcLNILwshcLnv++5P0aRRMqTgtVib S6npHnci9LJW8f4zxJhfJzPKhA6Ln/GUOpCloSLhamqOVyrbaR9EVnD2TizRhQDy 0VL6eardJBjJbclLTSt686+JMx6KVVqIWo81KgXlrXuEBPH1plrS5MRgv/yr595C 1dVjqrJCivh6L4qWJLIxcb2NF1fWj6n7WV16Bxw69xW7I8FAJXZjSPN3UzB7PaQz Ei9+IL/Cz3n7oj52hatR1T3LO2yrhgzUaVfkvWqumlNH8wILPWHAbZz4/07uwEo7 v8XqDXuChgn8JJH0fZ31tYEx8K1KfU09FdBqaTcZlMVOBDfKbfXovw0uONs1P+8h YJii2CdHrvOZxdLrta5NO7z2ZpNISpjmjvqendkExGV+7v/dxhesYKY98Js8WCBB z7ax+7sGzkEDMtzdxiXmCBl+PQoYazH9uiC8k9MXaFR/xo93Jgs= =fR1o -----END PGP SIGNATURE----- Merge tag 'v7.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "Fix a memory allocation overrun in crypto acomp" * tag 'v7.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: acomp - allocate async request context when cloning
This commit is contained in:
commit
9df08cdd33
|
|
@ -559,12 +559,22 @@ EXPORT_SYMBOL_GPL(acomp_walk_virt);
|
|||
struct acomp_req *acomp_request_clone(struct acomp_req *req,
|
||||
size_t total, gfp_t gfp)
|
||||
{
|
||||
struct crypto_tfm *tfm = req->base.tfm;
|
||||
struct acomp_req *nreq;
|
||||
size_t len;
|
||||
|
||||
nreq = container_of(crypto_request_clone(&req->base, total, gfp),
|
||||
struct acomp_req, base);
|
||||
if (nreq == req)
|
||||
len = sizeof(*req) +
|
||||
crypto_acomp_reqsize(crypto_acomp_reqtfm(req));
|
||||
len = ALIGN(len, CRYPTO_MINALIGN);
|
||||
|
||||
nreq = kzalloc(len, gfp);
|
||||
if (!nreq) {
|
||||
req->base.tfm = tfm->fb;
|
||||
return req;
|
||||
}
|
||||
|
||||
memcpy(nreq, req, sizeof(*req));
|
||||
nreq->base.flags &= ~CRYPTO_TFM_REQ_ON_STACK;
|
||||
|
||||
if (req->src == &req->chain.ssg)
|
||||
nreq->src = &nreq->chain.ssg;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user