1. 08 Mar, 2024 6 commits
    • Jiri Pirko's avatar
      dpll: fix dpll_xa_ref_*_del() for multiple registrations · b446631f
      Jiri Pirko authored
      Currently, if there are multiple registrations of the same pin on the
      same dpll device, following warnings are observed:
      WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:143 dpll_xa_ref_pin_del.isra.0+0x21e/0x230
      WARNING: CPU: 5 PID: 2212 at drivers/dpll/dpll_core.c:223 __dpll_pin_unregister+0x2b3/0x2c0
      
      The problem is, that in both dpll_xa_ref_dpll_del() and
      dpll_xa_ref_pin_del() registration is only removed from list in case the
      reference count drops to zero. That is wrong, the registration has to
      be removed always.
      
      To fix this, remove the registration from the list and free
      it unconditionally, instead of doing it only when the ref reference
      counter reaches zero.
      
      Fixes: 9431063a ("dpll: core: Add DPLL framework base functions")
      Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarRahul Rameshbabu <rrameshbabu@nvidia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b446631f
    • Kévin L'hôpital's avatar
      net: phy: fix phy_get_internal_delay accessing an empty array · 4469c0c5
      Kévin L'hôpital authored
      The phy_get_internal_delay function could try to access to an empty
      array in the case that the driver is calling phy_get_internal_delay
      without defining delay_values and rx-internal-delay-ps or
      tx-internal-delay-ps is defined to 0 in the device-tree.
      This will lead to "unable to handle kernel NULL pointer dereference at
      virtual address 0". To avoid this kernel oops, the test should be delay
      >= 0. As there is already delay < 0 test just before, the test could
      only be size == 0.
      
      Fixes: 92252eec ("net: phy: Add a helper to return the index for of the internal delay")
      Co-developed-by: default avatarEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
      Signed-off-by: default avatarEnguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
      Signed-off-by: default avatarKévin L'hôpital <kevin.lhopital@savoirfairelinux.com>
      Reviewed-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4469c0c5
    • Sunil Goutham's avatar
      octeontx2-af: Fix devlink params · fc1b2901
      Sunil Goutham authored
      Devlink param for adjusting NPC MCAM high zone
      area is in wrong param list and is not getting
      activated on CN10KA silicon.
      That patch fixes this issue.
      
      Fixes: dd784287 ("octeontx2-af: Add new devlink param to configure maximum usable NIX block LFs")
      Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
      Signed-off-by: default avatarSai Krishna <saikrishnag@marvell.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fc1b2901
    • Eric Dumazet's avatar
      net: ip_tunnel: make sure to pull inner header in ip_tunnel_rcv() · b0ec2abf
      Eric Dumazet authored
      Apply the same fix than ones found in :
      
      8d975c15 ("ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv()")
      1ca1ba46 ("geneve: make sure to pull inner header in geneve_rx()")
      
      We have to save skb->network_header in a temporary variable
      in order to be able to recompute the network_header pointer
      after a pskb_inet_may_pull() call.
      
      pskb_inet_may_pull() makes sure the needed headers are in skb->head.
      
      syzbot reported:
      BUG: KMSAN: uninit-value in __INET_ECN_decapsulate include/net/inet_ecn.h:253 [inline]
       BUG: KMSAN: uninit-value in INET_ECN_decapsulate include/net/inet_ecn.h:275 [inline]
       BUG: KMSAN: uninit-value in IP_ECN_decapsulate include/net/inet_ecn.h:302 [inline]
       BUG: KMSAN: uninit-value in ip_tunnel_rcv+0xed9/0x2ed0 net/ipv4/ip_tunnel.c:409
        __INET_ECN_decapsulate include/net/inet_ecn.h:253 [inline]
        INET_ECN_decapsulate include/net/inet_ecn.h:275 [inline]
        IP_ECN_decapsulate include/net/inet_ecn.h:302 [inline]
        ip_tunnel_rcv+0xed9/0x2ed0 net/ipv4/ip_tunnel.c:409
        __ipgre_rcv+0x9bc/0xbc0 net/ipv4/ip_gre.c:389
        ipgre_rcv net/ipv4/ip_gre.c:411 [inline]
        gre_rcv+0x423/0x19f0 net/ipv4/ip_gre.c:447
        gre_rcv+0x2a4/0x390 net/ipv4/gre_demux.c:163
        ip_protocol_deliver_rcu+0x264/0x1300 net/ipv4/ip_input.c:205
        ip_local_deliver_finish+0x2b8/0x440 net/ipv4/ip_input.c:233
        NF_HOOK include/linux/netfilter.h:314 [inline]
        ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254
        dst_input include/net/dst.h:461 [inline]
        ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
        NF_HOOK include/linux/netfilter.h:314 [inline]
        ip_rcv+0x46f/0x760 net/ipv4/ip_input.c:569
        __netif_receive_skb_one_core net/core/dev.c:5534 [inline]
        __netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5648
        netif_receive_skb_internal net/core/dev.c:5734 [inline]
        netif_receive_skb+0x58/0x660 net/core/dev.c:5793
        tun_rx_batched+0x3ee/0x980 drivers/net/tun.c:1556
        tun_get_user+0x53b9/0x66e0 drivers/net/tun.c:2009
        tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2055
        call_write_iter include/linux/fs.h:2087 [inline]
        new_sync_write fs/read_write.c:497 [inline]
        vfs_write+0xb6b/0x1520 fs/read_write.c:590
        ksys_write+0x20f/0x4c0 fs/read_write.c:643
        __do_sys_write fs/read_write.c:655 [inline]
        __se_sys_write fs/read_write.c:652 [inline]
        __x64_sys_write+0x93/0xd0 fs/read_write.c:652
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b
      
      Uninit was created at:
        __alloc_pages+0x9a6/0xe00 mm/page_alloc.c:4590
        alloc_pages_mpol+0x62b/0x9d0 mm/mempolicy.c:2133
        alloc_pages+0x1be/0x1e0 mm/mempolicy.c:2204
        skb_page_frag_refill+0x2bf/0x7c0 net/core/sock.c:2909
        tun_build_skb drivers/net/tun.c:1686 [inline]
        tun_get_user+0xe0a/0x66e0 drivers/net/tun.c:1826
        tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2055
        call_write_iter include/linux/fs.h:2087 [inline]
        new_sync_write fs/read_write.c:497 [inline]
        vfs_write+0xb6b/0x1520 fs/read_write.c:590
        ksys_write+0x20f/0x4c0 fs/read_write.c:643
        __do_sys_write fs/read_write.c:655 [inline]
        __se_sys_write fs/read_write.c:652 [inline]
        __x64_sys_write+0x93/0xd0 fs/read_write.c:652
        do_syscall_x64 arch/x86/entry/common.c:52 [inline]
        do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x63/0x6b
      
      Fixes: c5441932 ("GRE: Refactor GRE tunneling code.")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0ec2abf
    • Shiming Cheng's avatar
      ipv6: fib6_rules: flush route cache when rule is changed · c4386ab4
      Shiming Cheng authored
      When rule policy is changed, ipv6 socket cache is not refreshed.
      The sock's skb still uses a outdated route cache and was sent to
      a wrong interface.
      
      To avoid this error we should update fib node's version when
      rule is changed. Then skb's route will be reroute checked as
      route cache version is already different with fib node version.
      The route cache is refreshed to match the latest rule.
      
      Fixes: 101367c2 ("[IPV6]: Policy Routing Rules")
      Signed-off-by: default avatarShiming Cheng <shiming.cheng@mediatek.com>
      Signed-off-by: default avatarLena Wang <lena.wang@mediatek.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c4386ab4
    • Oleksij Rempel's avatar
      net: dsa: microchip: make sure drive strength configuration is not lost by soft reset · e3fb8e8b
      Oleksij Rempel authored
      This driver has two separate reset sequence in different places:
      - gpio/HW reset on start of ksz_switch_register()
      - SW reset on start of ksz_setup()
      
      The second one will overwrite drive strength configuration made in the
      ksz_switch_register().
      
      To fix it, move ksz_parse_drive_strength() from ksz_switch_register() to
      ksz_setup().
      
      Fixes: d67d7247 ("net: dsa: microchip: Add drive strength configuration")
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Link: https://lore.kernel.org/r/20240304135612.814404-1-o.rempel@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e3fb8e8b
  2. 07 Mar, 2024 20 commits
  3. 06 Mar, 2024 14 commits