Merge tag 'net-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Oct 2022 00:24:59 +0000 (17:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 21 Oct 2022 00:24:59 +0000 (17:24 -0700)
Pull networking fixes from Paolo Abeni:
 "Including fixes from netfilter.

  Current release - regressions:

   - revert "net: fix cpu_max_bits_warn() usage in
     netif_attrmask_next{,_and}"

   - revert "net: sched: fq_codel: remove redundant resource cleanup in
     fq_codel_init()"

   - dsa: uninitialized variable in dsa_slave_netdevice_event()

   - eth: sunhme: uninitialized variable in happy_meal_init()

  Current release - new code bugs:

   - eth: octeontx2: fix resource not freed after malloc

  Previous releases - regressions:

   - sched: fix return value of qdisc ingress handling on success

   - sched: fix race condition in qdisc_graft()

   - udp: update reuse->has_conns under reuseport_lock.

   - tls: strp: make sure the TCP skbs do not have overlapping data

   - hsr: avoid possible NULL deref in skb_clone()

   - tipc: fix an information leak in tipc_topsrv_kern_subscr

   - phylink: add mac_managed_pm in phylink_config structure

   - eth: i40e: fix DMA mappings leak

   - eth: hyperv: fix a RX-path warning

   - eth: mtk: fix memory leaks

  Previous releases - always broken:

   - sched: cake: fix null pointer access issue when cake_init() fails"

* tag 'net-6.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (43 commits)
  net: phy: dp83822: disable MDI crossover status change interrupt
  net: sched: fix race condition in qdisc_graft()
  net: hns: fix possible memory leak in hnae_ae_register()
  wwan_hwsim: fix possible memory leak in wwan_hwsim_dev_new()
  sfc: include vport_id in filter spec hash and equal()
  genetlink: fix kdoc warnings
  selftests: add selftest for chaining of tc ingress handling to egress
  net: Fix return value of qdisc ingress handling on success
  net: sched: sfb: fix null pointer access issue when sfb_init() fails
  Revert "net: sched: fq_codel: remove redundant resource cleanup in fq_codel_init()"
  net: sched: cake: fix null pointer access issue when cake_init() fails
  ethernet: marvell: octeontx2 Fix resource not freed after malloc
  netfilter: nf_tables: relax NFTA_SET_ELEM_KEY_END set flags requirements
  netfilter: rpfilter/fib: Set ->flowic_uid correctly for user namespaces.
  ionic: catch NULL pointer issue on reconfig
  net: hsr: avoid possible NULL deref in skb_clone()
  bnxt_en: fix memory leak in bnxt_nvm_test()
  ip6mr: fix UAF issue in ip6mr_sk_done() when addrconf_init_net() failed
  udp: Update reuse->has_conns under reuseport_lock.
  net: ethernet: mediatek: ppe: Remove the unused function mtk_foe_entry_usable()
  ...

1  2 
MAINTAINERS
net/ipv4/datagram.c
net/ipv4/udp.c
net/ipv6/addrconf.c
net/sched/sch_cake.c
net/sched/sch_sfb.c

diff --combined MAINTAINERS
@@@ -752,7 -752,7 +752,7 @@@ ALIBABA PMU DRIVE
  M:    Shuai Xue <xueshuai@linux.alibaba.com>
  S:    Supported
  F:    Documentation/admin-guide/perf/alibaba_pmu.rst
 -F:    drivers/perf/alibaba_uncore_dwr_pmu.c
 +F:    drivers/perf/alibaba_uncore_drw_pmu.c
  
  ALIENWARE WMI DRIVER
  L:    Dell.Client.Kernel@dell.com
@@@ -4459,15 -4459,13 +4459,15 @@@ M:   Josef Bacik <josef@toxicpanda.com
  M:    David Sterba <dsterba@suse.com>
  L:    linux-btrfs@vger.kernel.org
  S:    Maintained
 -W:    http://btrfs.wiki.kernel.org/
 -Q:    http://patchwork.kernel.org/project/linux-btrfs/list/
 +W:    https://btrfs.readthedocs.io
 +W:    https://btrfs.wiki.kernel.org/
 +Q:    https://patchwork.kernel.org/project/linux-btrfs/list/
  C:    irc://irc.libera.chat/btrfs
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git
  F:    Documentation/filesystems/btrfs.rst
  F:    fs/btrfs/
  F:    include/linux/btrfs*
 +F:    include/trace/events/btrfs.h
  F:    include/uapi/linux/btrfs*
  
  BTTV VIDEO4LINUX DRIVER
@@@ -5268,7 -5266,6 +5268,7 @@@ F:      tools/testing/selftests/cgroup
  
  CONTROL GROUP - BLOCK IO CONTROLLER (BLKIO)
  M:    Tejun Heo <tj@kernel.org>
 +M:    Josef Bacik <josef@toxicpanda.com>
  M:    Jens Axboe <axboe@kernel.dk>
  L:    cgroups@vger.kernel.org
  L:    linux-block@vger.kernel.org
@@@ -5276,7 -5273,6 +5276,7 @@@ T:      git git://git.kernel.dk/linux-bloc
  F:    Documentation/admin-guide/cgroup-v1/blkio-controller.rst
  F:    block/bfq-cgroup.c
  F:    block/blk-cgroup.c
 +F:    block/blk-iocost.c
  F:    block/blk-iolatency.c
  F:    block/blk-throttle.c
  F:    include/linux/blk-cgroup.h
@@@ -15363,6 -15359,17 +15363,6 @@@ L:  linux-rdma@vger.kernel.or
  S:    Supported
  F:    drivers/infiniband/ulp/opa_vnic
  
 -OPEN FIRMWARE AND DEVICE TREE OVERLAYS
 -M:    Pantelis Antoniou <pantelis.antoniou@konsulko.com>
 -M:    Frank Rowand <frowand.list@gmail.com>
 -L:    devicetree@vger.kernel.org
 -S:    Maintained
 -F:    Documentation/devicetree/dynamic-resolution-notes.rst
 -F:    Documentation/devicetree/overlay-notes.rst
 -F:    drivers/of/overlay.c
 -F:    drivers/of/resolver.c
 -K:    of_overlay_notifier_
 -
  OPEN FIRMWARE AND FLATTENED DEVICE TREE
  M:    Rob Herring <robh+dt@kernel.org>
  M:    Frank Rowand <frowand.list@gmail.com>
@@@ -15375,9 -15382,6 +15375,9 @@@ F:   Documentation/ABI/testing/sysfs-firm
  F:    drivers/of/
  F:    include/linux/of*.h
  F:    scripts/dtc/
 +K:    of_overlay_notifier_
 +K:    of_overlay_fdt_apply
 +K:    of_overlay_remove
  
  OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
  M:    Rob Herring <robh+dt@kernel.org>
@@@ -15415,7 -15419,7 +15415,7 @@@ M:   Stafford Horne <shorne@gmail.com
  L:    openrisc@lists.librecores.org
  S:    Maintained
  W:    http://openrisc.io
 -T:    git git://github.com/openrisc/linux.git
 +T:    git https://github.com/openrisc/linux.git
  F:    Documentation/devicetree/bindings/openrisc/
  F:    Documentation/openrisc/
  F:    arch/openrisc/
@@@ -17706,7 -17710,6 +17706,7 @@@ M:   Palmer Dabbelt <palmer@dabbelt.com
  M:    Albert Ou <aou@eecs.berkeley.edu>
  L:    linux-riscv@lists.infradead.org
  S:    Supported
 +Q:    https://patchwork.kernel.org/project/linux-riscv/list/
  P:    Documentation/riscv/patch-acceptance.rst
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git
  F:    arch/riscv/
@@@ -17718,13 -17721,12 +17718,13 @@@ M:        Conor Dooley <conor.dooley@microchip
  M:    Daire McNamara <daire.mcnamara@microchip.com>
  L:    linux-riscv@lists.infradead.org
  S:    Supported
 -F:    Documentation/devicetree/bindings/clock/microchip,mpfs.yaml
 +F:    Documentation/devicetree/bindings/clock/microchip,mpfs*.yaml
  F:    Documentation/devicetree/bindings/gpio/microchip,mpfs-gpio.yaml
  F:    Documentation/devicetree/bindings/i2c/microchip,corei2c.yaml
  F:    Documentation/devicetree/bindings/mailbox/microchip,mpfs-mailbox.yaml
  F:    Documentation/devicetree/bindings/net/can/microchip,mpfs-can.yaml
  F:    Documentation/devicetree/bindings/pwm/microchip,corepwm.yaml
 +F:    Documentation/devicetree/bindings/riscv/microchip.yaml
  F:    Documentation/devicetree/bindings/soc/microchip/microchip,mpfs-sys-controller.yaml
  F:    Documentation/devicetree/bindings/spi/microchip,mpfs-spi.yaml
  F:    Documentation/devicetree/bindings/usb/microchip,mpfs-musb.yaml
@@@ -18215,7 -18217,6 +18215,6 @@@ F:   include/media/drv-intf/s3c_camif.
  
  SAMSUNG S3FWRN5 NFC DRIVER
  M:    Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
- M:    Krzysztof Opasiak <k.opasiak@samsung.com>
  L:    linux-nfc@lists.01.org (subscribers-only)
  S:    Maintained
  F:    Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
@@@ -18521,7 -18522,8 +18520,7 @@@ S:   Maintaine
  F:    drivers/mmc/host/sdhci-esdhc-imx.c
  
  SECURE ENCRYPTING DEVICE (SED) OPAL DRIVER
 -M:    Jonathan Derrick <jonathan.derrick@intel.com>
 -M:    Revanth Rajashekar <revanth.rajashekar@intel.com>
 +M:    Jonathan Derrick <jonathan.derrick@linux.dev>
  L:    linux-block@vger.kernel.org
  S:    Supported
  F:    block/opal_proto.h
@@@ -21297,7 -21299,7 +21296,7 @@@ L:   linux-usb@vger.kernel.or
  L:    netdev@vger.kernel.org
  S:    Maintained
  W:    https://github.com/petkan/pegasus
- T:    git git://github.com/petkan/pegasus.git
+ T:    git https://github.com/petkan/pegasus.git
  F:    drivers/net/usb/pegasus.*
  
  USB PHY LAYER
@@@ -21334,7 -21336,7 +21333,7 @@@ L:   linux-usb@vger.kernel.or
  L:    netdev@vger.kernel.org
  S:    Maintained
  W:    https://github.com/petkan/rtl8150
- T:    git git://github.com/petkan/rtl8150.git
+ T:    git https://github.com/petkan/rtl8150.git
  F:    drivers/net/usb/rtl8150.c
  
  USB SERIAL SUBSYSTEM
diff --combined net/ipv4/datagram.c
@@@ -70,10 -70,10 +70,10 @@@ int __ip4_datagram_connect(struct sock 
        }
        inet->inet_daddr = fl4->daddr;
        inet->inet_dport = usin->sin_port;
-       reuseport_has_conns(sk, true);
+       reuseport_has_conns_set(sk);
        sk->sk_state = TCP_ESTABLISHED;
        sk_set_txhash(sk);
 -      inet->inet_id = prandom_u32();
 +      inet->inet_id = get_random_u16();
  
        sk_dst_set(sk, &rt->dst);
        err = 0;
diff --combined net/ipv4/udp.c
@@@ -246,7 -246,7 +246,7 @@@ int udp_lib_get_port(struct sock *sk, u
                inet_get_local_port_range(net, &low, &high);
                remaining = (high - low) + 1;
  
 -              rand = prandom_u32();
 +              rand = get_random_u32();
                first = reciprocal_scale(rand, remaining) + low;
                /*
                 * force rand to be an odd multiple of UDP_HTABLE_SIZE
@@@ -448,7 -448,7 +448,7 @@@ static struct sock *udp4_lib_lookup2(st
                        result = lookup_reuseport(net, sk, skb,
                                                  saddr, sport, daddr, hnum);
                        /* Fall back to scoring if group has connections */
-                       if (result && !reuseport_has_conns(sk, false))
+                       if (result && !reuseport_has_conns(sk))
                                return result;
  
                        result = result ? : sk;
diff --combined net/ipv6/addrconf.c
@@@ -104,7 -104,7 +104,7 @@@ static inline u32 cstamp_delta(unsigne
  static inline s32 rfc3315_s14_backoff_init(s32 irt)
  {
        /* multiply 'initial retransmission time' by 0.9 .. 1.1 */
 -      u64 tmp = (900000 + prandom_u32() % 200001) * (u64)irt;
 +      u64 tmp = (900000 + prandom_u32_max(200001)) * (u64)irt;
        do_div(tmp, 1000000);
        return (s32)tmp;
  }
  static inline s32 rfc3315_s14_backoff_update(s32 rt, s32 mrt)
  {
        /* multiply 'retransmission timeout' by 1.9 .. 2.1 */
 -      u64 tmp = (1900000 + prandom_u32() % 200001) * (u64)rt;
 +      u64 tmp = (1900000 + prandom_u32_max(200001)) * (u64)rt;
        do_div(tmp, 1000000);
        if ((s32)tmp > mrt) {
                /* multiply 'maximum retransmission time' by 0.9 .. 1.1 */
 -              tmp = (900000 + prandom_u32() % 200001) * (u64)mrt;
 +              tmp = (900000 + prandom_u32_max(200001)) * (u64)mrt;
                do_div(tmp, 1000000);
        }
        return (s32)tmp;
@@@ -3967,7 -3967,7 +3967,7 @@@ static void addrconf_dad_kick(struct in
        if (ifp->flags & IFA_F_OPTIMISTIC)
                rand_num = 0;
        else
 -              rand_num = prandom_u32() % (idev->cnf.rtr_solicit_delay ? : 1);
 +              rand_num = prandom_u32_max(idev->cnf.rtr_solicit_delay ?: 1);
  
        nonce = 0;
        if (idev->cnf.enhanced_dad ||
@@@ -7214,9 -7214,11 +7214,11 @@@ err_reg_dflt
        __addrconf_sysctl_unregister(net, all, NETCONFA_IFINDEX_ALL);
  err_reg_all:
        kfree(dflt);
+       net->ipv6.devconf_dflt = NULL;
  #endif
  err_alloc_dflt:
        kfree(all);
+       net->ipv6.devconf_all = NULL;
  err_alloc_all:
        kfree(net->ipv6.inet6_addr_lst);
  err_alloc_addr:
diff --combined net/sched/sch_cake.c
@@@ -573,7 -573,7 +573,7 @@@ static bool cobalt_should_drop(struct c
  
        /* Simple BLUE implementation.  Lack of ECN is deliberate. */
        if (vars->p_drop)
 -              drop |= (prandom_u32() < vars->p_drop);
 +              drop |= (get_random_u32() < vars->p_drop);
  
        /* Overload the drop_next field as an activity timeout */
        if (!vars->count)
@@@ -2092,11 -2092,11 +2092,11 @@@ retry
  
                WARN_ON(host_load > CAKE_QUEUES);
  
 -              /* The shifted prandom_u32() is a way to apply dithering to
 -               * avoid accumulating roundoff errors
 +              /* The get_random_u16() is a way to apply dithering to avoid
 +               * accumulating roundoff errors
                 */
                flow->deficit += (b->flow_quantum * quantum_div[host_load] +
 -                                (prandom_u32() >> 16)) >> 16;
 +                                get_random_u16()) >> 16;
                list_move_tail(&flow->flowchain, &b->old_flows);
  
                goto retry;
  
  static void cake_reset(struct Qdisc *sch)
  {
+       struct cake_sched_data *q = qdisc_priv(sch);
        u32 c;
  
+       if (!q->tins)
+               return;
        for (c = 0; c < CAKE_MAX_TINS; c++)
                cake_clear_tin(sch, c);
  }
diff --combined net/sched/sch_sfb.c
@@@ -379,7 -379,7 +379,7 @@@ static int sfb_enqueue(struct sk_buff *
                goto enqueue;
        }
  
 -      r = prandom_u32() & SFB_MAX_PROB;
 +      r = get_random_u16() & SFB_MAX_PROB;
  
        if (unlikely(r < p_min)) {
                if (unlikely(p_min > SFB_MAX_PROB / 2)) {
@@@ -455,7 -455,8 +455,8 @@@ static void sfb_reset(struct Qdisc *sch
  {
        struct sfb_sched_data *q = qdisc_priv(sch);
  
-       qdisc_reset(q->qdisc);
+       if (likely(q->qdisc))
+               qdisc_reset(q->qdisc);
        q->slot = 0;
        q->double_buffering = false;
        sfb_zero_all_buckets(q);