diff mbox series

crypto: cavium/nitrox - Use after free in process_response_list()

Message ID 20190104064611.GA30627@kadam (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series crypto: cavium/nitrox - Use after free in process_response_list() | expand

Commit Message

Dan Carpenter Jan. 4, 2019, 6:46 a.m. UTC
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>
---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Jan. 10, 2019, 2:05 p.m. UTC | #1
On Fri, Jan 04, 2019 at 09:46:11AM +0300, Dan Carpenter wrote:
> 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>
> ---
>  drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
index e34e4df8fd24..fe070d75c842 100644
--- a/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
+++ b/drivers/crypto/cavium/nitrox/nitrox_reqmgr.c
@@ -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++;
 	}