netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net 0/6] rtnetlink: Handle error of rtnl_register_module().
@ 2024-10-07 12:44 Kuniyuki Iwashima
  2024-10-07 12:44 ` [PATCH v3 net 1/6] rtnetlink: Add bulk registration helpers for rtnetlink message handlers Kuniyuki Iwashima
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Kuniyuki Iwashima @ 2024-10-07 12:44 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

While converting phonet to per-netns RTNL, I found a weird comment

  /* Further rtnl_register_module() cannot fail */

that was true but no longer true after commit addf9b90de22 ("net:
rtnetlink: use rcu to free rtnl message handlers").

Many callers of rtnl_register_module() just ignore the returned
value but should handle that properly.

This series introduces two helpers, rtnl_register_many() and
rtnl_unregister_many(), to do that easily and fix such callers.

All rtnl_register() and rtnl_register_module() will be converted
to _many() variant and some rtnl_lock() will be saved in _many()
later in net-next.


Changes:
  v3
    * Move module *owner to struct rtnl_msg_handler
    * Make struct rtnl_msg_handler args/vars const
    * Update mctp goto labels

  v2: https://lore.kernel.org/netdev/20241004222358.79129-1-kuniyu@amazon.com/
    * Remove __exit from mctp_neigh_exit().

  v1: https://lore.kernel.org/netdev/20241003205725.5612-1-kuniyu@amazon.com/


Kuniyuki Iwashima (6):
  rtnetlink: Add bulk registration helpers for rtnetlink message
    handlers.
  vxlan: Handle error of rtnl_register_module().
  bridge: Handle error of rtnl_register_module().
  mctp: Handle error of rtnl_register_module().
  mpls: Handle error of rtnl_register_module().
  phonet: Handle error of rtnl_register_module().

 drivers/net/vxlan/vxlan_core.c      |  6 +++++-
 drivers/net/vxlan/vxlan_private.h   |  2 +-
 drivers/net/vxlan/vxlan_vnifilter.c | 19 ++++++++---------
 include/net/mctp.h                  |  2 +-
 include/net/rtnetlink.h             | 17 +++++++++++++++
 net/bridge/br_netlink.c             |  6 +++++-
 net/bridge/br_private.h             |  5 +++--
 net/bridge/br_vlan.c                | 19 ++++++++---------
 net/core/rtnetlink.c                | 29 +++++++++++++++++++++++++
 net/mctp/af_mctp.c                  |  6 +++++-
 net/mctp/device.c                   | 30 +++++++++++++++-----------
 net/mctp/neigh.c                    | 31 ++++++++++++++++-----------
 net/mctp/route.c                    | 33 ++++++++++++++++++++---------
 net/mpls/af_mpls.c                  | 32 ++++++++++++++++++----------
 net/phonet/pn_netlink.c             | 28 ++++++++++--------------
 15 files changed, 176 insertions(+), 89 deletions(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-10-07 23:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 12:44 [PATCH v3 net 0/6] rtnetlink: Handle error of rtnl_register_module() Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 1/6] rtnetlink: Add bulk registration helpers for rtnetlink message handlers Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 2/6] vxlan: Handle error of rtnl_register_module() Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 3/6] bridge: " Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 4/6] mctp: " Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 5/6] mpls: " Kuniyuki Iwashima
2024-10-07 14:56   ` Eric W. Biederman
2024-10-07 15:42     ` Kuniyuki Iwashima
2024-10-07 16:28       ` Eric W. Biederman
2024-10-07 18:21         ` Kuniyuki Iwashima
2024-10-07 22:18           ` Eric W. Biederman
2024-10-07 23:48             ` Kuniyuki Iwashima
2024-10-07 12:44 ` [PATCH v3 net 6/6] phonet: " Kuniyuki Iwashima

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).