Skip to content

Commit 3866038

Browse files
Dan Carpentermartinkpetersen
authored andcommitted
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: e33c248 ("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>
1 parent f308a35 commit 3866038

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/cxgbi/libcxgbi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2457,10 +2457,10 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task)
24572457
return err;
24582458
}
24592459

2460-
__kfree_skb(skb);
24612460
log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
24622461
"itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
24632462
task->itt, skb, skb->len, skb->data_len, err);
2463+
__kfree_skb(skb);
24642464
iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);
24652465
iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);
24662466
return err;

0 commit comments

Comments
 (0)