projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40fd884
)
scsi: qla2xxx: Fix use after free in debug code
author
Dan Carpenter
<dan.carpenter@oracle.com>
Tue, 3 Aug 2021 15:56:25 +0000
(18:56 +0300)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Fri, 6 Aug 2021 03:21:08 +0000
(23:21 -0400)
The sp->free(sp); call frees "sp" and then the debug code dereferences
it on the next line. Swap the order.
Link:
https://lore.kernel.org/r/20210803155625.GA22735@kili
Fixes: 84318a9f01ce ("scsi: qla2xxx: edif: Add send, receive, and accept for auth_els")
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_bsg.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/qla2xxx/qla_bsg.c
b/drivers/scsi/qla2xxx/qla_bsg.c
index 0739f8ad525a1cd51d328eb6c64ca280bc26f4d4..4b5d28d89d6906462364f6c8207937dce43e66c2 100644
(file)
--- a/
drivers/scsi/qla2xxx/qla_bsg.c
+++ b/
drivers/scsi/qla2xxx/qla_bsg.c
@@
-25,12
+25,12
@@
void qla2x00_bsg_job_done(srb_t *sp, int res)
struct bsg_job *bsg_job = sp->u.bsg_job;
struct fc_bsg_reply *bsg_reply = bsg_job->reply;
- sp->free(sp);
-
ql_dbg(ql_dbg_user, sp->vha, 0x7009,
"%s: sp hdl %x, result=%x bsg ptr %p\n",
__func__, sp->handle, res, bsg_job);
+ sp->free(sp);
+
bsg_reply->result = res;
bsg_job_done(bsg_job, bsg_reply->result,
bsg_reply->reply_payload_rcv_len);