[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iJmqwihU3qqxYZ1Y7qZ9X0OabEc91r4T8gi6+1OA8voaw@mail.gmail.com>
Date: Thu, 21 Sep 2023 21:15:01 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: David Ahern <dsahern@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 3/8] inet: implement lockless IP_TOS
On Thu, Sep 21, 2023 at 9:10 PM David Ahern <dsahern@...nel.org> wrote:
>
> On 9/21/23 7:30 AM, Eric Dumazet wrote:
> > Some reads of inet->tos are racy.
> >
> > Add needed READ_ONCE() annotations and convert IP_TOS option lockless.
> >
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > ---
> > include/net/ip.h | 1 -
> > net/dccp/ipv4.c | 2 +-
> > net/ipv4/inet_diag.c | 2 +-
> > net/ipv4/ip_output.c | 4 +--
> > net/ipv4/ip_sockglue.c | 29 ++++++++-----------
> > net/ipv4/tcp_ipv4.c | 9 +++---
> > net/mptcp/sockopt.c | 8 ++---
> > net/sctp/protocol.c | 4 +--
> > .../selftests/net/mptcp/mptcp_connect.sh | 2 +-
> > 9 files changed, 28 insertions(+), 33 deletions(-)
> >
>
> include/net/route.h dereferences sk tos as well.
Right, thanks for catching this.
> net/ipv4/icmp.c has a setting of it
This is safe, the socket is private to the current thread ( sk =
icmp_xmit_lock()) and not visible to other threads.
Powered by blists - more mailing lists