net/smc: fixes for -net
cover net/smc: fixes for -net
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(-)
Signature · 1 line
2.17.1
PATCH 1/2 net/smc: transfer fasync_list in case of fallback
From: Ursula Braun <[email protected]>
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.
--- net/smc/af_smc.c | 2 ++ 1 file changed, 2 insertions(+)
net/smc/af_smc.c +2 -0
@@ -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; } }
Signature · 1 line
2.17.1
PATCH 2/2 net/smc: no peer ID in CLC decline for SMCD
In reply to Karsten GraulFrom: Ursula Braun <[email protected]>
Just SMCR requires a CLC Peer ID, but not SMCD. The field should be zero for SMCD.
--- net/smc/smc_clc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/smc/smc_clc.c +3 -1
@@ -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 ));
Signature · 1 line
2.17.1
David Miller
maintainerFrom: Karsten Graul <[email protected]>
Date: Fri, 14 Feb 2020 08:58:58 +0100
Quoted 1 line
Fix a syzbot finding and a problem with the CLC handshake content.
Series applied, thank you.