Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-08-08 18:42:47 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-08-08 18:50:59 +0200
commit4f6b2c544b156a81b6bfab6636e7d080373fc1f8 (patch)
treecc2d21d0d470f0c30d15bbe751299a7966f05a42
parent9e0538c9935aefc93b37920e4606a72687d12db5 (diff)
s390/qeth: release cmd buffer in error paths (bsc#1142109
LTC#179339).
-rw-r--r--patches.fixes/s390-qeth-release-cmd-buffer-in-error-paths62
-rw-r--r--series.conf1
2 files changed, 63 insertions, 0 deletions
diff --git a/patches.fixes/s390-qeth-release-cmd-buffer-in-error-paths b/patches.fixes/s390-qeth-release-cmd-buffer-in-error-paths
new file mode 100644
index 0000000000..e4a8b98961
--- /dev/null
+++ b/patches.fixes/s390-qeth-release-cmd-buffer-in-error-paths
@@ -0,0 +1,62 @@
+From: Julian Wiedmann <jwi@linux.ibm.com>
+Date: Mon, 4 Feb 2019 17:40:06 +0100
+Subject: s390/qeth: release cmd buffer in error paths
+Git-commit: 5065b2dd3e5f9247a6c9d67974bc0472bf561b9d
+Patch-mainline: v5.0-rc6
+References: bsc#1142109 LTC#179339
+
+Whenever we fail before/while starting an IO, make sure to release the
+IO buffer. Usually qeth_irq() would do this for us, but if the IO
+doesn't even start we obviously won't get an interrupt for it either.
+
+Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+[ ptesarik: Use iob->channel where channel is not declared. ]
+Signed-off-by: Petr Tesarik <ptesarik@suse.com>
+---
+ drivers/s390/net/qeth_core_main.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/s390/net/qeth_core_main.c
++++ b/drivers/s390/net/qeth_core_main.c
+@@ -559,6 +559,7 @@ static int __qeth_issue_next_read(struct
+ QETH_DBF_MESSAGE(2, "error %i on device %x when starting next read ccw!\n",
+ rc, CARD_DEVID(card));
+ atomic_set(&card->read.irq_pending, 0);
++ qeth_release_buffer(iob->channel, iob);
+ card->read_or_write_problem = 1;
+ qeth_schedule_recovery(card);
+ wake_up(&card->wait_q);
+@@ -1187,6 +1188,8 @@ static void qeth_irq(struct ccw_device *
+ rc = qeth_get_problem(cdev, irb);
+ if (rc) {
+ card->read_or_write_problem = 1;
++ if (iob)
++ qeth_release_buffer(iob->channel, iob);
+ qeth_clear_ipacmd_list(card);
+ qeth_schedule_recovery(card);
+ goto out;
+@@ -1835,6 +1838,7 @@ static int qeth_idx_activate_get_answer(
+ QETH_DBF_MESSAGE(2, "Error2 in activating channel rc=%d\n", rc);
+ QETH_DBF_TEXT_(SETUP, 2, "2err%d", rc);
+ atomic_set(&channel->irq_pending, 0);
++ qeth_release_buffer(channel, iob);
+ wake_up(&card->wait_q);
+ return rc;
+ }
+@@ -1907,6 +1911,7 @@ static int qeth_idx_activate_channel(str
+ rc);
+ QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
+ atomic_set(&channel->irq_pending, 0);
++ qeth_release_buffer(channel, iob);
+ wake_up(&card->wait_q);
+ return rc;
+ }
+@@ -2089,6 +2094,7 @@ int qeth_send_control_data(struct qeth_c
+ }
+ reply = qeth_alloc_reply(card);
+ if (!reply) {
++ qeth_release_buffer(iob->channel, iob);
+ return -ENOMEM;
+ }
+ reply->callback = reply_cb;
diff --git a/series.conf b/series.conf
index 559956938d..74066a9a20 100644
--- a/series.conf
+++ b/series.conf
@@ -21368,6 +21368,7 @@
patches.fixes/vsock-virtio-reset-connected-sockets-on-device-remov.patch
patches.suse/net-systemport-Fix-WoL-with-password-after-deep-slee.patch
patches.suse/net-dp83640-expire-old-TX-skb.patch
+ patches.fixes/s390-qeth-release-cmd-buffer-in-error-paths
patches.suse/0001-s390-qeth-fix-use-after-free-in-error-path.patch
patches.fixes/0001-s390-qeth-cancel-close_dev-work-before-removing-a-ca.patch
patches.fixes/0001-s390-qeth-conclude-all-event-processing-before-offli.patch