]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
stable fix for scsi patch for 4.9
authorSasha Levin <sashal@kernel.org>
Thu, 17 Jan 2019 20:50:45 +0000 (15:50 -0500)
committerSasha Levin <sashal@kernel.org>
Sat, 19 Jan 2019 01:59:20 +0000 (20:59 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/revert-scsi-target-iscsi-cxgbit-fix-csk-leak.patch [new file with mode: 0644]
queue-4.9/scsi-target-iscsi-cxgbit-fix-csk-leak-1.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/revert-scsi-target-iscsi-cxgbit-fix-csk-leak.patch b/queue-4.9/revert-scsi-target-iscsi-cxgbit-fix-csk-leak.patch
new file mode 100644 (file)
index 0000000..7a480ef
--- /dev/null
@@ -0,0 +1,46 @@
+From 515a056d6420c8b015e5578f8102ca1d46befa95 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 14 Jan 2019 10:01:30 -0500
+Subject: Revert "scsi: target: iscsi: cxgbit: fix csk leak"
+
+This reverts commit 8323aafe67b31c7f73d18747604ba1cc6c3e4f3a.
+
+A wrong commit message was used for the stable commit because of a human
+error (and duplicate commit subject lines).
+
+This patch reverts this error, and the following patches add the two
+upstream commits.
+
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/target/iscsi/cxgbit/cxgbit_cm.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+index 8652475e01d0..2fb1bf1a26c5 100644
+--- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c
++++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+@@ -631,11 +631,8 @@ static void cxgbit_send_halfclose(struct cxgbit_sock *csk)
+ static void cxgbit_arp_failure_discard(void *handle, struct sk_buff *skb)
+ {
+-      struct cxgbit_sock *csk = handle;
+-
+       pr_debug("%s cxgbit_device %p\n", __func__, handle);
+       kfree_skb(skb);
+-      cxgbit_put_csk(csk);
+ }
+ static void cxgbit_abort_arp_failure(void *handle, struct sk_buff *skb)
+@@ -1139,7 +1136,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
+       rpl5->opt0 = cpu_to_be64(opt0);
+       rpl5->opt2 = cpu_to_be32(opt2);
+       set_wr_txq(skb, CPL_PRIORITY_SETUP, csk->ctrlq_idx);
+-      t4_set_arp_err_handler(skb, csk, cxgbit_arp_failure_discard);
++      t4_set_arp_err_handler(skb, NULL, cxgbit_arp_failure_discard);
+       cxgbit_l2t_send(csk->com.cdev, skb, csk->l2t);
+ }
+-- 
+2.19.1
+
diff --git a/queue-4.9/scsi-target-iscsi-cxgbit-fix-csk-leak-1.patch b/queue-4.9/scsi-target-iscsi-cxgbit-fix-csk-leak-1.patch
new file mode 100644 (file)
index 0000000..dc93e05
--- /dev/null
@@ -0,0 +1,44 @@
+From d39e64c1e542c130b357b4df1f854bcd27bfea11 Mon Sep 17 00:00:00 2001
+From: Varun Prakash <varun@chelsio.com>
+Date: Fri, 9 Nov 2018 20:59:01 +0530
+Subject: scsi: target: iscsi: cxgbit: fix csk leak
+
+[ Upstream commit ed076c55b359cc9982ca8b065bcc01675f7365f6 ]
+
+In case of arp failure call cxgbit_put_csk() to free csk.
+
+Signed-off-by: Varun Prakash <varun@chelsio.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/target/iscsi/cxgbit/cxgbit_cm.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+index 2fb1bf1a26c5..8652475e01d0 100644
+--- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c
++++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+@@ -631,8 +631,11 @@ static void cxgbit_send_halfclose(struct cxgbit_sock *csk)
+ static void cxgbit_arp_failure_discard(void *handle, struct sk_buff *skb)
+ {
++      struct cxgbit_sock *csk = handle;
++
+       pr_debug("%s cxgbit_device %p\n", __func__, handle);
+       kfree_skb(skb);
++      cxgbit_put_csk(csk);
+ }
+ static void cxgbit_abort_arp_failure(void *handle, struct sk_buff *skb)
+@@ -1136,7 +1139,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
+       rpl5->opt0 = cpu_to_be64(opt0);
+       rpl5->opt2 = cpu_to_be32(opt2);
+       set_wr_txq(skb, CPL_PRIORITY_SETUP, csk->ctrlq_idx);
+-      t4_set_arp_err_handler(skb, NULL, cxgbit_arp_failure_discard);
++      t4_set_arp_err_handler(skb, csk, cxgbit_arp_failure_discard);
+       cxgbit_l2t_send(csk->com.cdev, skb, csk->l2t);
+ }
+-- 
+2.19.1
+
index 616ee0e4bc78f99528ffbe2ab2ae09083560ce65..f1e19d759b626d3d8a372dcfffa58d31a9fa64b4 100644 (file)
@@ -6,3 +6,5 @@ can-gw-ensure-dlc-boundaries-after-can-frame-modification.patch
 revert-f2fs-do-not-recover-from-previous-remained-wrong-dnodes.patch
 media-em28xx-fix-misplaced-reset-of-dev-v4l-field_count.patch
 proc-remove-empty-line-in-proc-self-status.patch
+revert-scsi-target-iscsi-cxgbit-fix-csk-leak.patch
+scsi-target-iscsi-cxgbit-fix-csk-leak-1.patch