]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
crypto: cavium/nitrox - Use after free in process_response_list()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 4 Jan 2019 06:46:11 +0000 (09:46 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Jan 2019 13:37:31 +0000 (21:37 +0800)
We free "sr" and then dereference it on the next line.

Fixes: c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c

index e34e4df8fd246275201dabdc53dc7f8570a6434f..fe070d75c842695f3b9b1c9fff9c4e80955e1849 100644 (file)
@@ -567,10 +567,10 @@ static void process_response_list(struct nitrox_cmdq *cmdq)
 
                /* ORH error code */
                err = READ_ONCE(*sr->resp.orh) & 0xff;
-               softreq_destroy(sr);
 
                if (sr->callback)
                        sr->callback(sr->cb_arg, err);
+               softreq_destroy(sr);
 
                req_completed++;
        }