diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2020-08-24 11:59:33 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-08-24 23:00:57 -0400 |
commit | 38660389a7697ae6dd56edfac5d87754374f217a (patch) | |
tree | 69b442c3c6b8641ede60604852f7ce344d804bc0 /drivers/scsi | |
parent | f308a35f547cd7c1d8a901c12b3ac508e96df665 (diff) | |
download | linux-38660389a7697ae6dd56edfac5d87754374f217a.tar.gz linux-38660389a7697ae6dd56edfac5d87754374f217a.tar.bz2 linux-38660389a7697ae6dd56edfac5d87754374f217a.zip |
scsi: libcxgbi: Fix a use after free in cxgbi_conn_xmit_pdu()
We accidentally move this logging printk after the free, but that leads to
a use after free.
Link: https://lore.kernel.org/r/20200824085933.GD208317@mwanda
Fixes: e33c2482289b ("scsi: cxgb4i: Add support for iSCSI segmentation offload")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index 71aebaf533ea..0e8621a6956d 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -2457,10 +2457,10 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task) return err; } - __kfree_skb(skb); log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX, "itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n", task->itt, skb, skb->len, skb->data_len, err); + __kfree_skb(skb); iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err); iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED); return err; |