Fixes from the main networking tree only.

Current release - regressions:

  - fix unwanted sign extension in netdev_stats_to_stats64()

Current release - new code bugs:

 - initialize net->notrefcnt_tracker earlier

 - devlink: fix netdev notifier chain corruption

 - nfp: make sure mbox accesses in IPsec code are atomic

 - ice: fix check for weight and priority of a scheduling node

Previous releases - regressions:

 - ice: xsk: fix cleaning of XDP_TX frame, prevent inf loop

 - igb: fix I2C bit banging config with external thermal sensor

Previous releases - always broken:

 - sched: tcindex: update imperfect hash filters respecting rcu

 - mpls: fix stale pointer if allocation fails during device rename

 - dccp/tcp: avoid negative sk_forward_alloc by ipv6_pinfo.pktoptions

 - remove WARN_ON_ONCE(sk->sk_forward_alloc) from sk_stream_kill_queues()

 - af_key: fix heap information leak

 - ipv6: fix socket connection with DSCP (correct interpretation
   of the tclass field vs fib rule matching)

 - tipc: fix kernel warning when sending SYN message

 - vmxnet3: read RSS information from the correct descriptor (eop)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
devlink: Fix netdev notifier chain corruption

Cited commit changed devlink to register its netdev notifier block on
the global netdev notifier chain instead of on the per network namespace
one.

However, when changing the network namespace of the devlink instance,
devlink still tries to unregister its notifier block from the chain of
the old namespace and register it on the chain of the new namespace.
This results in corruption of the notifier chains, as the same notifier
block is registered on two different chains: The global one and the per
network namespace one. In turn, this causes other problems such as the
inability to dismantle namespaces due to netdev reference count issues.

Fix by preventing devlink from moving its notifier block between
namespaces.

Reproducer:

 # echo "10 1" > /sys/bus/netdevsim/new_device
 # ip netns add test123
 # devlink dev reload netdevsim/netdevsim10 netns test123
 # ip netns del test123
 [   71.935619] unregister_netdevice: waiting for lo to become free. Usage count = 2
 [   71.938348] leaked reference.

Fixes: 565b4824c39f ("devlink: change port event netdev notifier from per-net to global")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230215073139.1360108-1-idosch@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
3 files changed