* [PATCH V2 net 0/1] net/ipv4: SMC and SYN Cookies
@ 2018-03-23 10:05 Ursula Braun
2018-03-23 10:05 ` [PATCH V2 net 1/1] net/ipv4: disable SMC TCP option with " Ursula Braun
0 siblings, 1 reply; 3+ messages in thread
From: Ursula Braun @ 2018-03-23 10:05 UTC (permalink / raw)
To: davem
Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun,
hwippel, eric.dumazet
Dave,
net/smc code is based on the SMC TCP experimental option.
Please apply Hans' patch to fix an inconsistency when SYN cookies
are active.
V2 includes the changes proposed by Eric Dumazet.
Thanks, Ursula
Hans Wippel (1):
net/ipv4: disable SMC TCP option with SYN Cookies
net/ipv4/syncookies.c | 2 ++
net/ipv4/tcp_input.c | 3 +++
net/ipv6/syncookies.c | 2 ++
3 files changed, 7 insertions(+)
--
2.13.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH V2 net 1/1] net/ipv4: disable SMC TCP option with SYN Cookies
2018-03-23 10:05 [PATCH V2 net 0/1] net/ipv4: SMC and SYN Cookies Ursula Braun
@ 2018-03-23 10:05 ` Ursula Braun
2018-03-26 0:54 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Ursula Braun @ 2018-03-23 10:05 UTC (permalink / raw)
To: davem
Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, ubraun,
hwippel, eric.dumazet
From: Hans Wippel <hwippel@linux.vnet.ibm.com>
Currently, the SMC experimental TCP option in a SYN packet is lost on
the server side when SYN Cookies are active. However, the corresponding
SYNACK sent back to the client contains the SMC option. This causes an
inconsistent view of the SMC capabilities on the client and server.
This patch disables the SMC option in the SYNACK when SYN Cookies are
active to avoid this issue.
Fixes: 60e2a7780793b ("tcp: TCP experimental option for SMC")
Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
---
net/ipv4/syncookies.c | 2 ++
net/ipv4/tcp_input.c | 3 +++
net/ipv6/syncookies.c | 2 ++
3 files changed, 7 insertions(+)
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index fda37f2862c9..c3387dfd725b 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -349,6 +349,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
req->ts_recent = tcp_opt.saw_tstamp ? tcp_opt.rcv_tsval : 0;
treq->snt_synack = 0;
treq->tfo_listener = false;
+ if (IS_ENABLED(CONFIG_SMC))
+ ireq->smc_ok = 0;
ireq->ir_iif = inet_request_bound_dev_if(sk, skb);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9a1b3c1c1c14..ff6cd98ce8d5 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -6256,6 +6256,9 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
if (want_cookie && !tmp_opt.saw_tstamp)
tcp_clear_options(&tmp_opt);
+ if (IS_ENABLED(CONFIG_SMC) && want_cookie)
+ tmp_opt.smc_ok = 0;
+
tmp_opt.tstamp_ok = tmp_opt.saw_tstamp;
tcp_openreq_init(req, &tmp_opt, skb, sk);
inet_rsk(req)->no_srccheck = inet_sk(sk)->transparent;
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index e7a3a6b6cf56..e997141aed8c 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -217,6 +217,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
treq->snt_isn = cookie;
treq->ts_off = 0;
treq->txhash = net_tx_rndhash();
+ if (IS_ENABLED(CONFIG_SMC))
+ ireq->smc_ok = 0;
/*
* We need to lookup the dst_entry to get the correct window size.
--
2.13.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH V2 net 1/1] net/ipv4: disable SMC TCP option with SYN Cookies
2018-03-23 10:05 ` [PATCH V2 net 1/1] net/ipv4: disable SMC TCP option with " Ursula Braun
@ 2018-03-26 0:54 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2018-03-26 0:54 UTC (permalink / raw)
To: ubraun
Cc: netdev, linux-s390, schwidefsky, heiko.carstens, raspl, hwippel,
eric.dumazet
From: Ursula Braun <ubraun@linux.vnet.ibm.com>
Date: Fri, 23 Mar 2018 11:05:45 +0100
> From: Hans Wippel <hwippel@linux.vnet.ibm.com>
>
> Currently, the SMC experimental TCP option in a SYN packet is lost on
> the server side when SYN Cookies are active. However, the corresponding
> SYNACK sent back to the client contains the SMC option. This causes an
> inconsistent view of the SMC capabilities on the client and server.
>
> This patch disables the SMC option in the SYNACK when SYN Cookies are
> active to avoid this issue.
>
> Fixes: 60e2a7780793b ("tcp: TCP experimental option for SMC")
> Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
> Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-26 0:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-23 10:05 [PATCH V2 net 0/1] net/ipv4: SMC and SYN Cookies Ursula Braun
2018-03-23 10:05 ` [PATCH V2 net 1/1] net/ipv4: disable SMC TCP option with " Ursula Braun
2018-03-26 0:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).