All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net/smc: fixes for -net
@ 2020-02-14  7:58 Karsten Graul
  2020-02-14  7:58 ` [PATCH net 1/2] net/smc: transfer fasync_list in case of fallback Karsten Graul
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Karsten Graul @ 2020-02-14  7:58 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

Fix a syzbot finding and a problem with the CLC handshake content.

Ursula Braun (2):
  net/smc: transfer fasync_list in case of fallback
  net/smc: no peer ID in CLC decline for SMCD

 net/smc/af_smc.c  | 2 ++
 net/smc/smc_clc.c | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net 1/2] net/smc: transfer fasync_list in case of fallback
  2020-02-14  7:58 [PATCH net 0/2] net/smc: fixes for -net Karsten Graul
@ 2020-02-14  7:58 ` Karsten Graul
  2020-02-14  7:59 ` [PATCH net 2/2] net/smc: no peer ID in CLC decline for SMCD Karsten Graul
  2020-02-14 15:14 ` [PATCH net 0/2] net/smc: fixes for -net David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Karsten Graul @ 2020-02-14  7:58 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

From: Ursula Braun <ubraun@linux.ibm.com>

SMC does not work together with FASTOPEN. If sendmsg() is called with
flag MSG_FASTOPEN in SMC_INIT state, the SMC-socket switches to
fallback mode. To handle the previous ioctl FIOASYNC call correctly
in this case, it is necessary to transfer the socket wait queue
fasync_list to the internal TCP socket.

Reported-by: syzbot+4b1fe8105f8044a26162@syzkaller.appspotmail.com
Fixes: ee9dfbef02d18 ("net/smc: handle sockopts forcing fallback")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/af_smc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index cee5bf4a9bb9..90988a511cd5 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -470,6 +470,8 @@ static void smc_switch_to_fallback(struct smc_sock *smc)
 	if (smc->sk.sk_socket && smc->sk.sk_socket->file) {
 		smc->clcsock->file = smc->sk.sk_socket->file;
 		smc->clcsock->file->private_data = smc->clcsock;
+		smc->clcsock->wq.fasync_list =
+			smc->sk.sk_socket->wq.fasync_list;
 	}
 }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net 2/2] net/smc: no peer ID in CLC decline for SMCD
  2020-02-14  7:58 [PATCH net 0/2] net/smc: fixes for -net Karsten Graul
  2020-02-14  7:58 ` [PATCH net 1/2] net/smc: transfer fasync_list in case of fallback Karsten Graul
@ 2020-02-14  7:59 ` Karsten Graul
  2020-02-14 15:14 ` [PATCH net 0/2] net/smc: fixes for -net David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Karsten Graul @ 2020-02-14  7:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

From: Ursula Braun <ubraun@linux.ibm.com>

Just SMCR requires a CLC Peer ID, but not SMCD. The field should be
zero for SMCD.

Fixes: c758dfddc1b5 ("net/smc: add SMC-D support in CLC messages")
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/smc_clc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/smc/smc_clc.c b/net/smc/smc_clc.c
index 0879f7bed967..86cccc24e52e 100644
--- a/net/smc/smc_clc.c
+++ b/net/smc/smc_clc.c
@@ -372,7 +372,9 @@ int smc_clc_send_decline(struct smc_sock *smc, u32 peer_diag_info)
 	dclc.hdr.length = htons(sizeof(struct smc_clc_msg_decline));
 	dclc.hdr.version = SMC_CLC_V1;
 	dclc.hdr.flag = (peer_diag_info == SMC_CLC_DECL_SYNCERR) ? 1 : 0;
-	memcpy(dclc.id_for_peer, local_systemid, sizeof(local_systemid));
+	if (smc->conn.lgr && !smc->conn.lgr->is_smcd)
+		memcpy(dclc.id_for_peer, local_systemid,
+		       sizeof(local_systemid));
 	dclc.peer_diagnosis = htonl(peer_diag_info);
 	memcpy(dclc.trl.eyecatcher, SMC_EYECATCHER, sizeof(SMC_EYECATCHER));
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/2] net/smc: fixes for -net
  2020-02-14  7:58 [PATCH net 0/2] net/smc: fixes for -net Karsten Graul
  2020-02-14  7:58 ` [PATCH net 1/2] net/smc: transfer fasync_list in case of fallback Karsten Graul
  2020-02-14  7:59 ` [PATCH net 2/2] net/smc: no peer ID in CLC decline for SMCD Karsten Graul
@ 2020-02-14 15:14 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2020-02-14 15:14 UTC (permalink / raw)
  To: kgraul; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

From: Karsten Graul <kgraul@linux.ibm.com>
Date: Fri, 14 Feb 2020 08:58:58 +0100

> Fix a syzbot finding and a problem with the CLC handshake content.

Series applied, thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/2] net/smc: fixes for -net
  2019-10-23 13:44 Karsten Graul
@ 2019-10-26  2:18 ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-10-26  2:18 UTC (permalink / raw)
  To: kgraul; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

From: Karsten Graul <kgraul@linux.ibm.com>
Date: Wed, 23 Oct 2019 15:44:04 +0200

> Fixes for the net tree, covering a memleak when closing
> SMC fallback sockets and fix SMC-R connection establishment
> when vlan-ids are used.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net 0/2] net/smc: fixes for -net
@ 2019-10-23 13:44 Karsten Graul
  2019-10-26  2:18 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Karsten Graul @ 2019-10-23 13:44 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, heiko.carstens, raspl, ubraun

Fixes for the net tree, covering a memleak when closing
SMC fallback sockets and fix SMC-R connection establishment
when vlan-ids are used.

Ursula Braun (2):
  net/smc: fix closing of fallback SMC sockets
  net/smc: keep vlan_id for SMC-R in smc_listen_work()

 net/smc/af_smc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-14 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14  7:58 [PATCH net 0/2] net/smc: fixes for -net Karsten Graul
2020-02-14  7:58 ` [PATCH net 1/2] net/smc: transfer fasync_list in case of fallback Karsten Graul
2020-02-14  7:59 ` [PATCH net 2/2] net/smc: no peer ID in CLC decline for SMCD Karsten Graul
2020-02-14 15:14 ` [PATCH net 0/2] net/smc: fixes for -net David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-10-23 13:44 Karsten Graul
2019-10-26  2:18 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.