[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200604.160032.1940917295284318635.davem@davemloft.net>
Date: Thu, 04 Jun 2020 16:00:32 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: pabeni@...hat.com
Cc: netdev@...r.kernel.org, mathew.j.martineau@...ux.intel.com,
kuba@...nel.org, mptcp@...ts.01.org, edumazet@...gle.com,
cpaasch@...le.com
Subject: Re: [PATCH net] inet_connection_sock: clear inet_num out of
destroy helper
From: Paolo Abeni <pabeni@...hat.com>
Date: Thu, 4 Jun 2020 18:55:45 +0200
> Clearing the 'inet_num' field is necessary and safe if and
> only if the socket is not bound. The MPTCP protocol calls
> the destroy helper on bound sockets, as tcp_v{4,6}_syn_recv_sock
> completed successfully.
>
> Move the clearing of such field out of the common code, otherwise
> the MPTCP MP_JOIN error path will find the wrong 'inet_num' value
> on socket disposal, __inet_put_port() will acquire the wrong lock
> and bind_node removal could race with other modifiers possibly
> corrupting the bind hash table.
>
> Reported-and-tested-by: Christoph Paasch <cpaasch@...le.com>
> Fixes: 729cd6436f35 ("mptcp: cope better with MP_JOIN failure")
> Signed-off-by: Paolo Abeni <pabeni@...hat.com>
Applied, thanks Paolo.
Powered by blists - more mailing lists