netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH v2 net-next 00/10]
Date: Fri, 13 May 2022 11:55:40 -0700	[thread overview]
Message-ID: <20220513185550.844558-1-eric.dumazet@gmail.com> (raw)

From: Eric Dumazet <edumazet@google.com>

net: add annotations for sk->sk_bound_dev_if

While writes on sk->sk_bound_dev_if are protected by socket lock,
we have many lockless reads all over the places.

This is based on syzbot report found in the first patch changelog.

v2: inline ipv6 function only defined if IS_ENABLED(CONFIG_IPV6) (kernel bots)
    Change the INET6_MATCH() to inet6_match(), this is no longer a macro.
    Change INET_MATCH() to inet_match() (Olivier Hartkopp & Jakub Kicinski)

Eric Dumazet (10):
  net: annotate races around sk->sk_bound_dev_if
  sctp: read sk->sk_bound_dev_if once in sctp_rcv()
  tcp: sk->sk_bound_dev_if once in inet_request_bound_dev_if()
  net: core: add READ_ONCE/WRITE_ONCE annotations for
    sk->sk_bound_dev_if
  dccp: use READ_ONCE() to read sk->sk_bound_dev_if
  inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict()
  net_sched: em_meta: add READ_ONCE() in var_sk_bound_if()
  l2tp: use add READ_ONCE() to fetch sk->sk_bound_dev_if
  ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH()
  inet: rename INET_MATCH()

 include/net/inet6_hashtables.h  | 28 +++++++++++++++++++---------
 include/net/inet_hashtables.h   |  2 +-
 include/net/inet_sock.h         |  5 +++--
 include/net/ip.h                |  2 +-
 include/net/sock.h              |  5 +++--
 net/core/sock.c                 | 11 +++++++----
 net/dccp/ipv4.c                 |  2 +-
 net/dccp/ipv6.c                 |  4 ++--
 net/ipv4/inet_connection_sock.c | 12 ++++++++----
 net/ipv4/inet_hashtables.c      | 10 +++++-----
 net/ipv4/udp.c                  |  2 +-
 net/ipv6/datagram.c             |  6 +++---
 net/ipv6/inet6_hashtables.c     |  6 +++---
 net/ipv6/udp.c                  | 13 +++++++------
 net/l2tp/l2tp_ip.c              |  4 +++-
 net/l2tp/l2tp_ip6.c             |  8 +++++---
 net/sched/em_meta.c             |  7 +++++--
 net/sctp/input.c                |  4 +++-
 18 files changed, 80 insertions(+), 51 deletions(-)

-- 
2.36.0.550.gb090851708-goog


             reply	other threads:[~2022-05-13 18:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 18:55 Eric Dumazet [this message]
2022-05-13 18:55 ` [PATCH v2 net-next 01/10] net: annotate races around sk->sk_bound_dev_if Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 02/10] sctp: read sk->sk_bound_dev_if once in sctp_rcv() Eric Dumazet
2022-05-13 19:46   ` Marcelo Ricardo Leitner
2022-05-13 18:55 ` [PATCH v2 net-next 03/10] tcp: sk->sk_bound_dev_if once in inet_request_bound_dev_if() Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 04/10] net: core: add READ_ONCE/WRITE_ONCE annotations for sk->sk_bound_dev_if Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 05/10] dccp: use READ_ONCE() to read sk->sk_bound_dev_if Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 06/10] inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict() Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 07/10] net_sched: em_meta: add READ_ONCE() in var_sk_bound_if() Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 08/10] l2tp: use add READ_ONCE() to fetch sk->sk_bound_dev_if Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 09/10] ipv6: add READ_ONCE(sk->sk_bound_dev_if) in INET6_MATCH() Eric Dumazet
2022-05-13 18:55 ` [PATCH v2 net-next 10/10] inet: rename INET_MATCH() Eric Dumazet
2022-05-16  9:40 ` [PATCH v2 net-next 00/10] patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220513185550.844558-1-eric.dumazet@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).