netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/11] inet: frags: avoid possible races at netns dismantle
@ 2019-05-24 16:03 Eric Dumazet
  2019-05-24 16:03 ` [PATCH net-next 01/11] inet: rename netns_frags to fqdir Eric Dumazet
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Eric Dumazet @ 2019-05-24 16:03 UTC (permalink / raw)
  To: David S . Miller; +Cc: netdev, Eric Dumazet, Eric Dumazet

This patch series fixes a race happening on netns dismantle with
frag queues. While rhashtable_free_and_destroy() is running,
concurrent timers might run inet_frag_kill() and attempt
rhashtable_remove_fast() calls. This is not allowed by
rhashtable logic.

Since I do not want to add expensive synchronize_rcu() calls
in the netns dismantle path, I had to no longer inline
netns_frags structures, but dynamically allocate them.

The ten first patches make this preparation, so that
the last patch clearly shows the fix.

As this patch series is not exactly trivial, I chose to
target 5.3. We will backport it once soaked a bit.

Eric Dumazet (11):
  inet: rename netns_frags to fqdir
  net: rename inet_frags_exit_net() to fqdir_exit()
  net: rename struct fqdir fields
  ipv4: no longer reference init_net in ip4_frags_ns_ctl_table[]
  ipv6: no longer reference init_net in ip6_frags_ns_ctl_table[]
  netfilter: ipv6: nf_defrag: no longer reference init_net in
    nf_ct_frag6_sysctl_table
  ieee820154: 6lowpan: no longer reference init_net in
    lowpan_frags_ns_ctl_table
  net: rename inet_frags_init_net() to fdir_init()
  net: add a net pointer to struct fqdir
  net: dynamically allocate fqdir structures
  inet: frags: rework rhashtable dismantle

 include/net/inet_frag.h                 | 48 ++++++++----
 include/net/netns/ieee802154_6lowpan.h  |  2 +-
 include/net/netns/ipv4.h                |  2 +-
 include/net/netns/ipv6.h                |  4 +-
 net/ieee802154/6lowpan/reassembly.c     | 36 ++++-----
 net/ipv4/inet_fragment.c                | 98 ++++++++++++++++---------
 net/ipv4/ip_fragment.c                  | 67 +++++++----------
 net/ipv4/proc.c                         |  4 +-
 net/ipv6/netfilter/nf_conntrack_reasm.c | 43 +++++------
 net/ipv6/proc.c                         |  4 +-
 net/ipv6/reassembly.c                   | 40 ++++------
 11 files changed, 181 insertions(+), 167 deletions(-)

-- 
2.22.0.rc1.257.g3120a18244-goog


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

end of thread, other threads:[~2019-06-07 12:07 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-24 16:03 [PATCH net-next 00/11] inet: frags: avoid possible races at netns dismantle Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 01/11] inet: rename netns_frags to fqdir Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 02/11] net: rename inet_frags_exit_net() to fqdir_exit() Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 03/11] net: rename struct fqdir fields Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 04/11] ipv4: no longer reference init_net in ip4_frags_ns_ctl_table[] Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 05/11] ipv6: no longer reference init_net in ip6_frags_ns_ctl_table[] Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 06/11] netfilter: ipv6: nf_defrag: no longer reference init_net in nf_ct_frag6_sysctl_table Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 07/11] ieee820154: 6lowpan: no longer reference init_net in lowpan_frags_ns_ctl_table Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 08/11] net: rename inet_frags_init_net() to fdir_init() Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 09/11] net: add a net pointer to struct fqdir Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 10/11] net: dynamically allocate fqdir structures Eric Dumazet
2019-05-24 16:03 ` [PATCH net-next 11/11] inet: frags: rework rhashtable dismantle Eric Dumazet
2019-05-28  6:34   ` Herbert Xu
2019-05-28 13:31     ` Eric Dumazet
2019-05-29  5:40       ` [PATCH] inet: frags: Remove unnecessary smp_store_release/READ_ONCE Herbert Xu
2019-05-29  5:43         ` Dmitry Vyukov
2019-05-29  5:47           ` Herbert Xu
2019-05-31  8:24             ` Dmitry Vyukov
2019-05-31 14:45               ` Herbert Xu
2019-05-31 15:45                 ` Eric Dumazet
2019-05-31 16:29                   ` Andrea Parri
2019-05-31 17:11                     ` Eric Dumazet
2019-06-07 12:06                       ` Dmitry Vyukov
2019-05-31 17:11                   ` Paul E. McKenney
2019-05-31 17:18                     ` Eric Dumazet
2019-05-29 21:30         ` Eric Dumazet
2019-05-30 18:51         ` David Miller
2019-05-26 21:26 ` [PATCH net-next 00/11] inet: frags: avoid possible races at netns dismantle David Miller

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