Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2019-04-04 13:53:03 +0200
committerPetr Tesarik <ptesarik@suse.cz>2019-04-04 15:22:56 +0200
commit4c282db22022887193c91e2a2a37d83445550161 (patch)
treed40d642a5be3a12dc158869615b8d4ee385834d4
parent75db11526a31d00681526259eb5f0301955b005d (diff)
net/smc: fix smc_poll in SMC_INIT state (bsc#1129855
LTC#176251).
-rw-r--r--patches.drivers/net-smc-fix-smc_poll-in-smc_init-state37
-rw-r--r--series.conf1
2 files changed, 38 insertions, 0 deletions
diff --git a/patches.drivers/net-smc-fix-smc_poll-in-smc_init-state b/patches.drivers/net-smc-fix-smc_poll-in-smc_init-state
new file mode 100644
index 0000000000..1bcf63db8d
--- /dev/null
+++ b/patches.drivers/net-smc-fix-smc_poll-in-smc_init-state
@@ -0,0 +1,37 @@
+From: Ursula Braun <ubraun@linux.ibm.com>
+Date: Thu, 21 Feb 2019 12:56:54 +0100
+Subject: net/smc: fix smc_poll in SMC_INIT state
+Git-commit: d7cf4a3bf3a83c977a29055e1c4ffada7697b31f
+Patch-mainline: v5.0-rc8
+References: bsc#1129855 LTC#176251
+
+smc_poll() returns with mask bit EPOLLPRI if the connection urg_state
+is SMC_URG_VALID. Since SMC_URG_VALID is zero, smc_poll signals
+EPOLLPRI errorneously if called in state SMC_INIT before the connection
+is created, for instance in a non-blocking connect scenario.
+
+This patch switches to non-zero values for the urg states.
+
+Reviewed-by: Karsten Graul <kgraul@linux.ibm.com>
+Fixes: de8474eb9d50 ("net/smc: urgent data support")
+Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+[ ptesarik: The upstream fix changes kABI by renumbering the enum. The
+ root cause of the original bug is an uninitialized struct member, so
+ an alternative fix is to initialize it properly and stop relying on
+ zeroing out the structure. ]
+Signed-off-by: Petr Tesarik <ptesarik@suse.com>
+---
+ net/smc/af_smc.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/net/smc/af_smc.c
++++ b/net/smc/af_smc.c
+@@ -208,6 +208,7 @@ static struct sock *smc_sock_alloc(struc
+ INIT_WORK(&smc->tcp_listen_work, smc_tcp_listen_work);
+ INIT_WORK(&smc->connect_work, smc_connect_work);
+ INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work);
++ smc->conn.urg_state = SMC_URG_READ;
+ INIT_LIST_HEAD(&smc->accept_q);
+ spin_lock_init(&smc->accept_q_lock);
+ spin_lock_init(&smc->conn.send_lock);
diff --git a/series.conf b/series.conf
index 0eeec8c833..656cf2401d 100644
--- a/series.conf
+++ b/series.conf
@@ -44300,6 +44300,7 @@
patches.suse/kallsyms-handle-too-long-symbols-in-kallsyms-c.patch
patches.drivers/scsi-libiscsi-fix-race-between-iscsi_xmit_task-and-iscsi_complete_task
patches.fixes/scsi-core-reset-host-byte-in-DID_NEXUS_FAILURE-case.patch
+ patches.drivers/net-smc-fix-smc_poll-in-smc_init-state
patches.drivers/i40e-fix-potential-RX-buffer-starvation-for-AF_XDP.patch
patches.drivers/ixgbe-fix-potential-RX-buffer-starvation-for-AF_XDP.patch
patches.drivers/i40e-fix-XDP_REDIRECT-XDP-xmit-ring-cleanup-race.patch