[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <503e65af-1cc7-4893-8569-632790171de8@kernel.org>
Date: Mon, 10 Jun 2024 09:30:08 -0600
From: David Ahern <dsahern@...nel.org>
To: Simon Horman <horms@...nel.org>, Eric Dumazet <edumazet@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Neal Cardwell <ncardwell@...gle.com>, eric.dumazet@...il.com
Subject: Re: [PATCH net] tcp: fix race in tcp_v6_syn_recv_sock()
On 6/8/24 7:25 AM, Simon Horman wrote:
> + David Ahern
>
> On Thu, Jun 06, 2024 at 03:46:51PM +0000, Eric Dumazet wrote:
>> tcp_v6_syn_recv_sock() calls ip6_dst_store() before
>> inet_sk(newsk)->pinet6 has been set up.
>>
>> This means ip6_dst_store() writes over the parent (listener)
>> np->dst_cookie.
>>
>> This is racy because multiple threads could share the same
>> parent and their final np->dst_cookie could be wrong.
>>
>> Move ip6_dst_store() call after inet_sk(newsk)->pinet6
>> has been changed and after the copy of parent ipv6_pinfo.
>>
>> Fixes: e994b2f0fb92 ("tcp: do not lock listener to process SYN packets")
>> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
>
> Reviewed-by: Simon Horman <horms@...nel.org>
>
>> ---
>> net/ipv6/tcp_ipv6.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
Reviewed-by: David Ahern <dsahern@...nel.org>
Powered by blists - more mailing lists