ib_srp: Fix use-after-free in srp_reset_req()
Subsystems (2)
PATCH 1/1 ib_srp: Fix use-after-free in srp_reset_req()
srp_free_req() uses the scsi_cmnd structure contents to unmap buffers, so we must invoke srp_free_req() before we release ownership of that structure.
--- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/infiniband/ulp/srp/ib_srp.c +1 -1
@@ -638,9 +638,9 @@ static void srp_reset_req(struct srp_target_port *target, struct srp_request *restruct scsi_cmnd *scmnd =srp_claim_req (target, req,NULL );if (scmnd) { +srp_free_req (target, req, scmnd,0 ); scmnd->result =DID_RESET <<16 ; scmnd->scsi_done (scmnd); -srp_free_req (target, req, scmnd,0 ); } }
Signature · 6 lines
1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Bart Van Assche
srp_free_req()uses thescsi_cmndstructure contents to unmap buffers, so we must invokesrp_free_req()before we release ownership of that structure.Signed-off-by Bart Van Assche <[email protected]>Acked-by David Dillow <[email protected]>Cc Roland Dreier <[email protected]>
Roland, are you planning to apply this one and the one Bart has that fixes the error handling (srp_aport)? I didn't see them in your pull request.
Thanks,
Signature · 10 lines
Dave Dillow National Center for Computational Science Oak Ridge National Laboratory (865) 241-6602 office -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1347910310.12412.5.camel-zHLflQxYYDO4Hhoo1DtQwJ9G+ZOsUmrO@public.gmane.org
Quoted 3 lines · David Dillow
Roland, are you planning to apply this one and the one Bart has that fixes the error handling (
srp_aport)? I didn't see them in your pull request.
Sorry, I guess I missed them.
I think I'll probably just put it into 3.7 with a stable tag at this point. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): CAL1RGDUA-bFbiiy7uvUBLRM7NpfNW6TPqF34yFo19+Z3=CNZGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 8 lines · Roland Dreier
Quoted 3 lines · David Dillow
Roland, are you planning to apply this one and the one Bart has that fixes the error handling (
srp_aport)? I didn't see them in your pull request.Sorry, I guess I missed them.
I think I'll probably just put it into 3.7 with a stable tag at this point.
Ok, as long as they make it to stable, I'm happy. Should you happen to have reason for another push for 3.6, please consider them.
Signature · 10 lines
Dave Dillow National Center for Computational Science Oak Ridge National Laboratory (865) 241-6602 office -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html