On 03/22/2018 06:23 AM, Ursula Braun wrote:
> We moved the clear to cookie_v4_check()/cookie_v6_check. However, this does
> not seem to
> be sufficient to prevent the SYNACK from containing the SMC experimental
> option.
> We found that an additional check in tcp_conn_request() helps:
>
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -6248,6 +6248,9 @@ int tcp_conn_request(struct request_sock
> if (want_cookie && !tmp_opt.saw_tstamp)
> tcp_clear_options(&tmp_opt);
>
> + if (IS_ENABLED(CONFIG_SMC) && want_cookie && tmp_opt.smc_ok)
> + 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;
>
> Do you think this could be the right place for clearing the smc_ok bit?
Yes, but since tmp_opt is private to this thread/cpu, no false sharing to be
afraid of
if (IS_ENABLED(CONFIG_SMC) && want_cookie)
tmp_opt.smc_ok = 0;