1. Oct 14, 2023
    • Jesse Brandeburg's avatar
      ice: fix over-shifted variable · 242e3450
      Jesse Brandeburg authored
      Since the introduction of the ice driver the code has been
      double-shifting the RSS enabling field, because the define already has
      shifts in it and can't have the regular pattern of "a << shiftval &
      mask" applied.
      
      Most places in the code got it right, but one line was still wrong. Fix
      this one location for easy backports to stable. An in-progress patch
      fixes the defines to "standard" and will be applied as part of the
      regular -next process sometime after this one.
      
      Fixes: d76a60ba
      
       ("ice: Add support for VLANs and offloads")
      Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
      CC: stable@vger.kernel.org
      Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Link: https://lore.kernel.org/r/20231010203101.406248-1-jacob.e.keller@intel.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      242e3450
    • Jinjie Ruan's avatar
      net: dsa: bcm_sf2: Fix possible memory leak in bcm_sf2_mdio_register() · 61b40cef
      Jinjie Ruan authored
      In bcm_sf2_mdio_register(), the class_find_device() will call get_device()
      to increment reference count for priv->master_mii_bus->dev if
      of_mdio_find_bus() succeeds. If mdiobus_alloc() or mdiobus_register()
      fails, it will call get_device() twice without decrement reference count
      for the device. And it is the same if bcm_sf2_mdio_register() succeeds but
      fails in bcm_sf2_sw_probe(), or if bcm_sf2_sw_probe() succeeds. If the
      reference count has not decremented to zero, the dev related resource will
      not be freed.
      
      So remove the get_device() in bcm_sf2_mdio_register(), and call
      put_device() if mdiobus_alloc() or mdiobus_register() fails and in
      bcm_sf2_mdio_unregister() to solve the issue.
      
      And as Simon suggested, unwind from errors for bcm_sf2_mdio_register() and
      just return 0 if it succeeds to make it cleaner.
      
      Fixes: 461cd1b0
      
       ("net: dsa: bcm_sf2: Register our slave MDIO bus")
      Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
      Suggested-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
      Link: https://lore.kernel.org/r/20231011032419.2423290-1-ruanjinjie@huawei.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      61b40cef
    • Jakub Kicinski's avatar
      Merge branch 'selftests-fib_tests-fixes-for-multipath-list-receive-tests' · dda5e1ee
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      selftests: fib_tests: Fixes for multipath list receive tests
      
      Fix two issues in recently added FIB multipath list receive tests.
      ====================
      
      Link: https://lore.kernel.org/r/20231010132113.3014691-1-idosch@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      dda5e1ee
    • Ido Schimmel's avatar
      selftests: fib_tests: Count all trace point invocations · aa13e524
      Ido Schimmel authored
      The tests rely on the IPv{4,6} FIB trace points being triggered once for
      each forwarded packet. If receive processing is deferred to the
      ksoftirqd task these invocations will not be counted and the tests will
      fail. Fix by specifying the '-a' flag to avoid perf from filtering on
      the mausezahn task.
      
      Before:
      
       # ./fib_tests.sh -t ipv4_mpath_list
      
       IPv4 multipath list receive tests
           TEST: Multipath route hit ratio (.68)                               [FAIL]
      
       # ./fib_tests.sh -t ipv6_mpath_list
      
       IPv6 multipath list receive tests
           TEST: Multipath route hit ratio (.27)                               [FAIL]
      
      After:
      
       # ./fib_tests.sh -t ipv4_mpath_list
      
       IPv4 multipath list receive tests
           TEST: Multipath route hit ratio (1.00)                              [ OK ]
      
       # ./fib_tests.sh -t ipv6_mpath_list
      
       IPv6 multipath list receive tests
           TEST: Multipath route hit ratio (.99)                               [ OK ]
      
      Fixes: 8ae9efb8
      
       ("selftests: fib_tests: Add multipath list receive tests")
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Closes: https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.com/
      
      
      Tested-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Tested-by: default avatarSriram Yagnaraman <sriram.yagnaraman@est.tech>
      Link: https://lore.kernel.org/r/20231010132113.3014691-3-idosch@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aa13e524
    • Ido Schimmel's avatar
      selftests: fib_tests: Disable RP filter in multipath list receive test · dbb13378
      Ido Schimmel authored
      The test relies on the fib:fib_table_lookup trace point being triggered
      once for each forwarded packet. If RP filter is not disabled, the trace
      point will be triggered twice for each packet (for source validation and
      forwarding), potentially masking actual bugs. Fix by explicitly
      disabling RP filter.
      
      Before:
      
       # ./fib_tests.sh -t ipv4_mpath_list
      
       IPv4 multipath list receive tests
           TEST: Multipath route hit ratio (1.99)                              [ OK ]
      
      After:
      
       # ./fib_tests.sh -t ipv4_mpath_list
      
       IPv4 multipath list receive tests
           TEST: Multipath route hit ratio (.99)                               [ OK ]
      
      Fixes: 8ae9efb8
      
       ("selftests: fib_tests: Add multipath list receive tests")
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Closes: https://lore.kernel.org/netdev/202309191658.c00d8b8-oliver.sang@intel.com/
      
      
      Tested-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Tested-by: default avatarSriram Yagnaraman <sriram.yagnaraman@est.tech>
      Link: https://lore.kernel.org/r/20231010132113.3014691-2-idosch@nvidia.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      dbb13378
    • Kuniyuki Iwashima's avatar
      tcp: Fix listen() warning with v4-mapped-v6 address. · 8702cf12
      Kuniyuki Iwashima authored
      syzbot reported a warning [0] introduced by commit c48ef9c4 ("tcp: Fix
      bind() regression for v4-mapped-v6 non-wildcard address.").
      
      After the cited commit, a v4 socket's address matches the corresponding
      v4-mapped-v6 tb2 in inet_bind2_bucket_match_addr(), not vice versa.
      
      During X.X.X.X -> ::ffff:X.X.X.X order bind()s, the second bind() uses
      bhash and conflicts properly without checking bhash2 so that we need not
      check if a v4-mapped-v6 sk matches the corresponding v4 address tb2 in
      inet_bind2_bucket_match_addr().  However, the repro shows that we need
      to check that in a no-conflict case.
      
      The repro bind()s two sockets to the 2-tuples using SO_REUSEPORT and calls
      listen() for the first socket:
      
        from socket import *
      
        s1 = socket()
        s1.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        s1.bind(('127.0.0.1', 0))
      
        s2 = socket(AF_INET6)
        s2.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        s2.bind(('::ffff:127.0.0.1', s1.getsockname()[1]))
      
        s1.listen()
      
      The second socket should belong to the first socket's tb2, but the second
      bind() creates another tb2 bucket because inet_bind2_bucket_find() returns
      NULL in inet_csk_get_port() as the v4-mapped-v6 sk does not match the
      corresponding v4 address tb2.
      
        bhash2[] -> tb2(::ffff:X.X.X.X) -> tb2(X.X.X.X)
      
      Then, listen() for the first socket calls inet_csk_get_port(), where the
      v4 address matches the v4-mapped-v6 tb2 and WARN_ON() is triggered.
      
      To avoid that, we need to check if v4-mapped-v6 sk address matches with
      the corresponding v4 address tb2 in inet_bind2_bucket_match().
      
      The same checks are needed in inet_bind2_bucket_addr_match() too, so we
      can move all checks there and call it from inet_bind2_bucket_match().
      
      Note that now tb->family is just an address family of tb->(v6_)?rcv_saddr
      and not of sockets in the bucket.  This could be refactored later by
      defining tb->rcv_saddr as tb->v6_rcv_saddr.s6_addr32[3] and prepending
      ::ffff: when creating v4 tb2.
      
      [0]:
      WARNING: CPU: 0 PID: 5049 at net/ipv4/inet_connection_sock.c:587 inet_csk_get_port+0xf96/0x2350 net/ipv4/inet_connection_sock.c:587
      Modules linked in:
      CPU: 0 PID: 5049 Comm: syz-executor288 Not tainted 6.6.0-rc2-syzkaller-00018-g2cf0f715 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
      RIP: 0010:inet_csk_get_port+0xf96/0x2350 net/ipv4/inet_connection_sock.c:587
      Code: 7c 24 08 e8 4c b6 8a 01 31 d2 be 88 01 00 00 48 c7 c7 e0 94 ae 8b e8 59 2e a3 f8 2e 2e 2e 31 c0 e9 04 fe ff ff e8 ca 88 d0 f8 <0f> 0b e9 0f f9 ff ff e8 be 88 d0 f8 49 8d 7e 48 e8 65 ca 5a 00 31
      RSP: 0018:ffffc90003abfbf0 EFLAGS: 00010293
      RAX: 0000000000000000 RBX: ffff888026429100 RCX: 0000000000000000
      RDX: ffff88807edcbb80 RSI: ffffffff88b73d66 RDI: ffff888026c49f38
      RBP: ffff888026c49f30 R08: 0000000000000005 R09: 0000000000000000
      R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff9260f200
      R13: ffff888026c49880 R14: 0000000000000000 R15: ffff888026429100
      FS:  00005555557d5380(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000000045ad50 CR3: 0000000025754000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <TASK>
       inet_csk_listen_start+0x155/0x360 net/ipv4/inet_connection_sock.c:1256
       __inet_listen_sk+0x1b8/0x5c0 net/ipv4/af_inet.c:217
       inet_listen+0x93/0xd0 net/ipv4/af_inet.c:239
       __sys_listen+0x194/0x270 net/socket.c:1866
       __do_sys_listen net/socket.c:1875 [inline]
       __se_sys_listen net/socket.c:1873 [inline]
       __x64_sys_listen+0x53/0x80 net/socket.c:1873
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x63/0xcd
      RIP: 0033:0x7f3a5bce3af9
      Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
      RSP: 002b:00007ffc1a1c79e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000032
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3a5bce3af9
      RDX: 00007f3a5bce3af9 RSI: 0000000000000000 RDI: 0000000000000003
      RBP: 00007f3a5bd565f0 R08: 0000000000000006 R09: 0000000000000006
      R10: 0000000000000006 R11: 0000000000000246 R12: 0000000000000001
      R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
       </TASK>
      
      Fixes: c48ef9c4
      
       ("tcp: Fix bind() regression for v4-mapped-v6 non-wildcard address.")
      Reported-by: default avatar <syzbot+71e724675ba3958edb31@syzkaller.appspotmail.com>
      Closes: https://syzkaller.appspot.com/bug?extid=71e724675ba3958edb31
      
      
      Signed-off-by: default avatarKuniyuki Iwashima <kuniyu@amazon.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Link: https://lore.kernel.org/r/20231010013814.70571-1-kuniyu@amazon.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      8702cf12
  2. Oct 13, 2023
    • Jiri Wiesner's avatar
      bonding: Return pointer to data after pull on skb · d93f3f99
      Jiri Wiesner authored
      Since 429e3d12 ("bonding: Fix extraction of ports from the packet
      headers"), header offsets used to compute a hash in bond_xmit_hash() are
      relative to skb->data and not skb->head. If the tail of the header buffer
      of an skb really needs to be advanced and the operation is successful, the
      pointer to the data must be returned (and not a pointer to the head of the
      buffer).
      
      Fixes: 429e3d12
      
       ("bonding: Fix extraction of ports from the packet headers")
      Signed-off-by: default avatarJiri Wiesner <jwiesner@suse.de>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d93f3f99
    • Linus Torvalds's avatar
      Merge tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · e8c127b0
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from CAN and BPF.
      
        We have a regression in TC currently under investigation, otherwise
        the things that stand off most are probably the TCP and AF_PACKET
        fixes, with both issues coming from 6.5.
      
        Previous releases - regressions:
      
         - af_packet: fix fortified memcpy() without flex array.
      
         - tcp: fix crashes trying to free half-baked MTU probes
      
         - xdp: fix zero-size allocation warning in xskq_create()
      
         - can: sja1000: always restart the tx queue after an overrun
      
         - eth: mlx5e: again mutually exclude RX-FCS and RX-port-timestamp
      
         - eth: nfp: avoid rmmod nfp crash issues
      
         - eth: octeontx2-pf: fix page pool frag allocation warning
      
        Previous releases - always broken:
      
         - mctp: perform route lookups under a RCU read-side lock
      
         - bpf: s390: fix clobbering the caller's backchain in the trampoline
      
         - phy: lynx-28g: cancel the CDR check work item on the remove path
      
         - dsa: qca8k: fix qca8k driver for Turris 1.x
      
         - eth: ravb: fix use-after-free issue in ravb_tx_timeout_work()
      
         - eth: ixgbe: fix crash with empty VF macvlan list"
      
      * tag 'net-6.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits)
        rswitch: Fix imbalance phy_power_off() calling
        rswitch: Fix renesas_eth_sw_remove() implementation
        octeontx2-pf: Fix page pool frag allocation warning
        nfc: nci: assert requested protocol is valid
        af_packet: Fix fortified memcpy() without flex array.
        net: tcp: fix crashes trying to free half-baked MTU probes
        net/smc: Fix pos miscalculation in statistics
        nfp: flower: avoid rmmod nfp crash issues
        net: usb: dm9601: fix uninitialized variable use in dm9601_mdio_read
        ethtool: Fix mod state of verbose no_mask bitset
        net: nfc: fix races in nfc_llcp_sock_get() and nfc_llcp_sock_get_sn()
        mctp: perform route lookups under a RCU read-side lock
        net: skbuff: fix kernel-doc typos
        s390/bpf: Fix unwinding past the trampoline
        s390/bpf: Fix clobbering the caller's backchain in the trampoline
        net/mlx5e: Again mutually exclude RX-FCS and RX-port-timestamp
        net/smc: Fix dependency of SMC on ISM
        ixgbe: fix crash with empty VF macvlan list
        net/mlx5e: macsec: use update_pn flag instead of PN comparation
        net: phy: mscc: macsec: reject PN update requests
        ...
      e8c127b0
    • Linus Torvalds's avatar
      Merge tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 9a5a1494
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "AngeloGioacchino Del Regno is stepping in as co-maintainer for the
        MediaTek SoC platform and starts by sending some dts fixes for the
        mt8195 platform that had been pending for a while.
      
        On the ixp4xx platform, Krzysztof Halasa steps down as co-maintainer,
        reflecting that Linus Walleij has been handling this on his own for
        the past few years.
      
        Generic RISC-V kernels are now marked as incompatible with the RZ/Five
        platform that requires custom hacks both for managing its DMA bounce
        buffers and for addressing low virtual memory.
      
       Finally, there is one bugfix for the AMDTEE firmware driver to prevent
       a use-after-free bug"
      
      * tag 'soc-fixes-6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
        IXP4xx MAINTAINERS entries
        arm64: dts: mediatek: mt8195: Set DSU PMU status to fail
        arm64: dts: mediatek: fix t-phy unit name
        arm64: dts: mediatek: mt8195-demo: update and reorder reserved memory regions
        arm64: dts: mediatek: mt8195-demo: fix the memory size to 8GB
        MAINTAINERS: Add Angelo as MediaTek SoC co-maintainer
        soc: renesas: Make ARCH_R9A07G043 (riscv version) depend on NONPORTABLE
        tee: amdtee: fix use-after-free vulnerability in amdtee_close_session
      9a5a1494
    • Linus Torvalds's avatar
      Merge tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm · 9b1ad4ba
      Linus Torvalds authored
      Pull pmdomain fix from Ulf Hansson:
      
       - imx: scu-pd: Correct the DMA2 channel
      
      * tag 'pmdomain-v6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
        pmdomain: imx: scu-pd: correct DMA2 channel
      9b1ad4ba
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 82a040a8
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Some pin control fixes for v6.6 which have been stacking up in my
        tree.
      
        Dmitry's fix to some locking in the core is the most substantial, that
        was a really neat fix.
      
        The rest is the usual assorted spray of minor driver fixes.
      
         - Drop some minor code causing warnings in the Lantiq driver
      
         - Fix out of bounds write in the Nuvoton driver
      
         - Fix lost IRQs with CONFIG_PM in the Starfive driver
      
         - Fix a locking issue in find_pinctrl()
      
         - Revert a regressive Tegra debug patch
      
         - Fix the Renesas RZN1 pin muxing"
      
      * tag 'pinctrl-v6.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: renesas: rzn1: Enable missing PINMUX
        Revert "pinctrl: tegra: Add support to display pin function"
        pinctrl: avoid unsafe code pattern in find_pinctrl()
        pinctrl: starfive: jh7110: Add system pm ops to save and restore context
        pinctrl: starfive: jh7110: Fix failure to set irq after CONFIG_PM is enabled
        pinctrl: nuvoton: wpcm450: fix out of bounds write
        pinctrl: lantiq: Remove unsued declaration ltq_pinctrl_unregister()
      82a040a8
  3. Oct 12, 2023
  4. Oct 11, 2023