lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250205155120.1676781-1-edumazet@google.com>
Date: Wed,  5 Feb 2025 15:51:08 +0000
From: Eric Dumazet <edumazet@...gle.com>
To: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, Kuniyuki Iwashima <kuniyu@...zon.com>, 
	Simon Horman <horms@...nel.org>, eric.dumazet@...il.com, 
	Eric Dumazet <edumazet@...gle.com>
Subject: [PATCH v4 net 00/12] net: first round to use dev_net_rcu()

dev_net(dev) should either be protected by RTNL or RCU.

There is no LOCKDEP support yet for this helper.

Adding it would trigger too many splats.

Instead, add dev_net_rcu() for rcu_read_lock() contexts
and start to use it to fix bugs and clearly document the
safety requirements.

v4: Shrink the series to limit number of potential iterations.
    Fix ip6_input() in a separate patch.
    Link: https://lore.kernel.org/netdev/CANn89i+AozhFhZNK0Y4e_EqXV1=yKjGuvf43Wa6JJKWMOixWQQ@mail.gmail.com/

v3: Rework patches 9 and 10 after Jakub feedback.
    Link: https://lore.kernel.org/netdev/20250203153633.46ce0337@kernel.org/
    Added some missing Fixes tags.

v2: Resend (one patch missed v1 train), plus minor fixes.

Eric Dumazet (12):
  net: add dev_net_rcu() helper
  ipv4: add RCU protection to ip4_dst_hoplimit()
  ipv4: use RCU protection in ip_dst_mtu_maybe_forward()
  ipv4: use RCU protection in ipv4_default_advmss()
  ipv4: use RCU protection in rt_is_expired()
  ipv4: use RCU protection in inet_select_addr()
  ipv4: use RCU protection in __ip_rt_update_pmtu()
  ipv4: icmp: convert to dev_net_rcu()
  flow_dissector: use RCU protection to fetch dev_net()
  ipv6: use RCU protection in ip6_default_advmss()
  ipv6: icmp: convert to dev_net_rcu()
  ipv6: Use RCU in ip6_input()

 include/linux/netdevice.h   |  6 ++++++
 include/net/ip.h            | 13 +++++++++---
 include/net/net_namespace.h |  2 +-
 include/net/route.h         |  9 ++++++--
 net/core/flow_dissector.c   | 21 ++++++++++---------
 net/ipv4/devinet.c          |  3 ++-
 net/ipv4/icmp.c             | 31 ++++++++++++++-------------
 net/ipv4/route.c            | 30 ++++++++++++++++++--------
 net/ipv6/icmp.c             | 42 ++++++++++++++++++++-----------------
 net/ipv6/ip6_input.c        | 14 ++++++++-----
 net/ipv6/route.c            |  7 ++++++-
 11 files changed, 113 insertions(+), 65 deletions(-)

-- 
2.48.1.362.g079036d154-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ