[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJwJo6bAAFv+02J7W_Yz0=LZUrvgpx=e6dFmQbWoy7AFKDbj-Q@mail.gmail.com>
Date: Sat, 27 Jul 2024 19:30:05 +0100
From: Dmitry Safonov <0x7f454c46@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Dmitry Safonov via B4 Relay <devnull+0x7f454c46.gmail.com@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, "David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...nel.org
Subject: Re: [PATCH net] net/tcp: Disable TCP-AO static key after RCU grace period
Hi Jakub,
On Sat, 27 Jul 2024 at 03:34, Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Thu, 25 Jul 2024 06:00:02 +0100 Dmitry Safonov via B4 Relay wrote:
> > @@ -290,9 +298,7 @@ void tcp_ao_destroy_sock(struct sock *sk, bool twsk)
> > atomic_sub(tcp_ao_sizeof_key(key), &sk->sk_omem_alloc);
> > call_rcu(&key->rcu, tcp_ao_key_free_rcu);
> > }
> > -
> > - kfree_rcu(ao, rcu);
> > - static_branch_slow_dec_deferred(&tcp_ao_needed);
> > + call_rcu(&ao->rcu, tcp_ao_info_free_rcu);
>
> Maybe free the keys inside tcp_ao_info_free_rcu, too?
> IIUC you're saying that new sock is still looking at this ao under RCU
> protection - messing with the key list feels a tiny bit odd since the
> object is technically "live" until the end of the RCU grace period.
Yeah, I think that's possible.
Looking at it now, I think it also needs
: rcu_assign_pointer(tp->ao_info, NULL)
above, rather than a plain null-assign.
Will fix and send v2.
Thanks,
Dmitry
Powered by blists - more mailing lists