From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH net] tcp: fastopen: tcp_connect() must refresh the route Date: Tue, 08 Aug 2017 21:04:17 -0700 (PDT) Message-ID: <20170808.210417.1748836096752126270.davem@davemloft.net> References: <1502181718.4487.9.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, weiwan@google.com, ycheng@google.com, dvyukov@google.com To: eric.dumazet@gmail.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:60254 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751957AbdHIEES (ORCPT ); Wed, 9 Aug 2017 00:04:18 -0400 In-Reply-To: <1502181718.4487.9.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Eric Dumazet Date: Tue, 08 Aug 2017 01:41:58 -0700 > From: Eric Dumazet > > With new TCP_FASTOPEN_CONNECT socket option, there is a possibility > to call tcp_connect() while socket sk_dst_cache is either NULL > or invalid. > > +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4 > +0 fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0 > +0 setsockopt(4, SOL_TCP, TCP_FASTOPEN_CONNECT, [1], 4) = 0 > +0 connect(4, ..., ...) = 0 > > << sk->sk_dst_cache becomes obsolete, or even set to NULL >> > > +1 sendto(4, ..., 1000, MSG_FASTOPEN, ..., ...) = 1000 > > > We need to refresh the route otherwise bad things can happen, > especially when syzkaller is running on the host :/ > > Fixes: 19f6d3f3c8422 ("net/tcp-fastopen: Add new API support") > Reported-by: Dmitry Vyukov > Signed-off-by: Eric Dumazet Applied and queued up for -stable.