Skip to contentSkip to conversation

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

PATCH In review Dan Carpenter 2 participants 2 messages Jan 4, 2019 – Jan 10, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

We free "sr" and then dereference it on the next line.

Fixes c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support")
---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +1 -1
index e34e4df8fd24..fe070d75c842 100644
@@ -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++;
 	}
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 7 lines · Dan Carpenter

We free "sr" and then dereference it on the next line.

Fixes c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support")
---
 drivers/crypto/cavium/nitrox/nitrox_reqmgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt