1. 24 Aug, 2023 24 commits
    • Luiz Augusto von Dentz's avatar
      Bluetooth: hci_sync: Fix UAF in hci_disconnect_all_sync · 94d9ba9f
      Luiz Augusto von Dentz authored
      Use-after-free can occur in hci_disconnect_all_sync if a connection is
      deleted by concurrent processing of a controller event.
      
      To prevent this the code now tries to iterate over the list backwards
      to ensure the links are cleanup before its parents, also it no longer
      relies on a cursor, instead it always uses the last element since
      hci_abort_conn_sync is guaranteed to call hci_conn_del.
      
      UAF crash log:
      ==================================================================
      BUG: KASAN: slab-use-after-free in hci_set_powered_sync
      (net/bluetooth/hci_sync.c:5424) [bluetooth]
      Read of size 8 at addr ffff888009d9c000 by task kworker/u9:0/124
      
      CPU: 0 PID: 124 Comm: kworker/u9:0 Tainted: G        W
      6.5.0-rc1+ #10
      Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS
      1.16.2-1.fc38 04/01/2014
      Workqueue: hci0 hci_cmd_sync_work [bluetooth]
      Call Trace:
       <TASK>
       dump_stack_lvl+0x5b/0x90
       print_report+0xcf/0x670
       ? __virt_addr_valid+0xdd/0x160
       ? hci_set_powered_sync+0x2c9/0x4a0 [bluetooth]
       kasan_report+0xa6/0xe0
       ? hci_set_powered_sync+0x2c9/0x4a0 [bluetooth]
       ? __pfx_set_powered_sync+0x10/0x10 [bluetooth]
       hci_set_powered_sync+0x2c9/0x4a0 [bluetooth]
       ? __pfx_hci_set_powered_sync+0x10/0x10 [bluetooth]
       ? __pfx_lock_release+0x10/0x10
       ? __pfx_set_powered_sync+0x10/0x10 [bluetooth]
       hci_cmd_sync_work+0x137/0x220 [bluetooth]
       process_one_work+0x526/0x9d0
       ? __pfx_process_one_work+0x10/0x10
       ? __pfx_do_raw_spin_lock+0x10/0x10
       ? mark_held_locks+0x1a/0x90
       worker_thread+0x92/0x630
       ? __pfx_worker_thread+0x10/0x10
       kthread+0x196/0x1e0
       ? __pfx_kthread+0x10/0x10
       ret_from_fork+0x2c/0x50
       </TASK>
      
      Allocated by task 1782:
       kasan_save_stack+0x33/0x60
       kasan_set_track+0x25/0x30
       __kasan_kmalloc+0x8f/0xa0
       hci_conn_add+0xa5/0xa80 [bluetooth]
       hci_bind_cis+0x881/0x9b0 [bluetooth]
       iso_connect_cis+0x121/0x520 [bluetooth]
       iso_sock_connect+0x3f6/0x790 [bluetooth]
       __sys_connect+0x109/0x130
       __x64_sys_connect+0x40/0x50
       do_syscall_64+0x60/0x90
       entry_SYSCALL_64_after_hwframe+0x6e/0xd8
      
      Freed by task 695:
       kasan_save_stack+0x33/0x60
       kasan_set_track+0x25/0x30
       kasan_save_free_info+0x2b/0x50
       __kasan_slab_free+0x10a/0x180
       __kmem_cache_free+0x14d/0x2e0
       device_release+0x5d/0xf0
       kobject_put+0xdf/0x270
       hci_disconn_complete_evt+0x274/0x3a0 [bluetooth]
       hci_event_packet+0x579/0x7e0 [bluetooth]
       hci_rx_work+0x287/0xaa0 [bluetooth]
       process_one_work+0x526/0x9d0
       worker_thread+0x92/0x630
       kthread+0x196/0x1e0
       ret_from_fork+0x2c/0x50
      ==================================================================
      
      Fixes: 182ee45d ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
      Signed-off-by: default avatarPauli Virtanen <pav@iki.fi>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      94d9ba9f
    • Neeraj Sanjay Kale's avatar
      Bluetooth: btnxpuart: Improve inband Independent Reset handling · 491f9eff
      Neeraj Sanjay Kale authored
      This improves the inband IR command handling for NXP BT chipsets.
      When the IR vendor command is received, the driver injects a HW
      error event, which causes a reset sequence in hci_error_reset().
      The vendor IR command is sent to the controller while hci dev
      is been closed, and FW is re-downloaded when nxp_setup() is
      called during hci_dev_do_open().
      The HCI_SETUP flag is set in nxp_hw_err() to make sure that
      nxp_setup() is been called during hci_dev_do_open().
      
      This also makes the nxp_setup() and power save functions more
      generic.
      Signed-off-by: default avatarNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      491f9eff
    • Neeraj Sanjay Kale's avatar
      Bluetooth: btnxpuart: Add support for IW624 chipset · 8b7630de
      Neeraj Sanjay Kale authored
      This adds support for NXP IW624 chipset in btnxpuart driver
      by adding FW name and bootloader signature. Based on the
      loader version bits 7:6 of the bootloader signature, the
      driver can choose between selecting secure and non-secure
      FW files.
      For cmd5 payload during FW download, this chip has addresses
      of few registers offset by 1, so added boot_reg_offset to
      handle the chip specific offset.
      Signed-off-by: default avatarNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      8b7630de
    • Neeraj Sanjay Kale's avatar
      Bluetooth: btnxpuart: Remove check for CTS low after FW download · 7de05cb4
      Neeraj Sanjay Kale authored
      This removes the unnecessary check for CTS low after FW download.
      
      After FW download is complete, the CTS line is already seen low.
      It becomes high after 2 msec, and low again after FW initialization
      is complete.
      This makes the current check for CTS low redundant.
      
      This removes the wait for CTS low section and increase delay to
      1200msec instead, which is sufficiant for all NXP chipsets to
      initialize FW.
      Signed-off-by: default avatarNeeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
      Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      7de05cb4
    • Krzysztof Kozlowski's avatar
      net: dsa: use capital "OR" for multiple licenses in SPDX · 59da9885
      Krzysztof Kozlowski authored
      Documentation/process/license-rules.rst and checkpatch expect the SPDX
      identifier syntax for multiple licenses to use capital "OR".  Correct it
      to keep consistent format and avoid copy-paste issues.
      Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Reviewed-by: Kurt Kanzenbach's avatarKurt Kanzenbach <kurt@linutronix.de>
      Reviewed-by: default avatarFLorian Fainelli <florian.fainelli@broadcom.com>
      Link: https://lore.kernel.org/r/20230823085632.116725-1-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      59da9885
    • Jakub Kicinski's avatar
      Merge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux · 3c5066c6
      Jakub Kicinski authored
      Leon Romanovsky says:
      
      ====================
      mlx5 MACsec RoCEv2 support
      
      From Patrisious:
      
      This series extends previously added MACsec offload support
      to cover RoCE traffic either.
      
      In order to achieve that, we need configure MACsec with offload between
      the two endpoints, like below:
      
      REMOTE_MAC=10:70:fd:43:71:c0
      
      * ip addr add 1.1.1.1/16 dev eth2
      * ip link set dev eth2 up
      * ip link add link eth2 macsec0 type macsec encrypt on
      * ip macsec offload macsec0 mac
      * ip macsec add macsec0 tx sa 0 pn 1 on key 00 dffafc8d7b9a43d5b9a3dfbbf6a30c16
      * ip macsec add macsec0 rx port 1 address $REMOTE_MAC
      * ip macsec add macsec0 rx port 1 address $REMOTE_MAC sa 0 pn 1 on key 01 ead3664f508eb06c40ac7104cdae4ce5
      * ip addr add 10.1.0.1/16 dev macsec0
      * ip link set dev macsec0 up
      
      And in a similar manner on the other machine, while noting the keys order
      would be reversed and the MAC address of the other machine.
      
      RDMA traffic is separated through relevant GID entries and in case
      of IP ambiguity issue - meaning we have a physical GIDs and a MACsec
      GIDs with the same IP/GID, we disable our physical GID in order
      to force the user to only use the MACsec GID.
      
      v0: https://lore.kernel.org/netdev/20230813064703.574082-1-leon@kernel.org/
      
      * 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux:
        RDMA/mlx5: Handles RoCE MACsec steering rules addition and deletion
        net/mlx5: Add RoCE MACsec steering infrastructure in core
        net/mlx5: Configure MACsec steering for ingress RoCEv2 traffic
        net/mlx5: Configure MACsec steering for egress RoCEv2 traffic
        IB/core: Reorder GID delete code for RoCE
        net/mlx5: Add MACsec priorities in RDMA namespaces
        RDMA/mlx5: Implement MACsec gid addition and deletion
        net/mlx5: Maintain fs_id xarray per MACsec device inside macsec steering
        net/mlx5: Remove netdevice from MACsec steering
        net/mlx5e: Move MACsec flow steering and statistics database from ethernet to core
        net/mlx5e: Rename MACsec flow steering functions/parameters to suit core naming style
        net/mlx5: Remove dependency of macsec flow steering on ethernet
        net/mlx5e: Move MACsec flow steering operations to be used as core library
        macsec: add functions to get macsec real netdevice and check offload
      ====================
      
      Link: https://lore.kernel.org/r/20230821073833.59042-1-leon@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3c5066c6
    • Jakub Kicinski's avatar
      docs: netdev: recommend against --in-reply-to · 35b4b6d0
      Jakub Kicinski authored
      It's somewhat unfortunate but with (my?) the current tooling
      if people post new versions of a set in reply to an old version
      managing the review queue gets difficult. So recommend against it.
      Reviewed-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
      Link: https://lore.kernel.org/r/20230823154922.1162644-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      35b4b6d0
    • Thomas Weißschuh's avatar
      net: generalize calculation of skb extensions length · 5d21d0a6
      Thomas Weißschuh authored
      Remove the necessity to modify skb_ext_total_length() when new extension
      types are added.
      Also reduces the line count a bit.
      
      With optimizations enabled the function is folded down to the same
      constant value as before during compilation.
      This has been validated on x86 with GCC 6.5.0 and 13.2.1.
      Also a similar construct has been validated on godbolt.org with GCC 5.1.
      In any case the compiler has to be able to evaluate the construct at
      compile-time for the BUILD_BUG_ON() in skb_extensions_init().
      
      Even if not evaluated at compile-time this function would only ever
      be executed once at run-time, so the overhead would be very minuscule.
      Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20230823-skb_ext-simplify-v2-1-66e26cd66860@weissschuh.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      5d21d0a6
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 57ce6427
      Jakub Kicinski authored
      Cross-merge networking fixes after downstream PR.
      
      Conflicts:
      
      include/net/inet_sock.h
        f866fbc8 ("ipv4: fix data-races around inet->inet_id")
        c274af22 ("inet: introduce inet->inet_flags")
      https://lore.kernel.org/all/679ddff6-db6e-4ff6-b177-574e90d0103d@tessares.net/
      
      Adjacent changes:
      
      drivers/net/bonding/bond_alb.c
        e74216b8 ("bonding: fix macvlan over alb bond support")
        f11e5bd1 ("bonding: support balance-alb with openvswitch")
      
      drivers/net/ethernet/broadcom/bgmac.c
        d6499f0b ("net: bgmac: Return PTR_ERR() for fixed_phy_register()")
        23a14488 ("net: bgmac: Fix return value check for fixed_phy_register()")
      
      drivers/net/ethernet/broadcom/genet/bcmmii.c
        32bbe64a ("net: bcmgenet: Fix return value check for fixed_phy_register()")
        acf50d1a ("net: bcmgenet: Return PTR_ERR() for fixed_phy_register()")
      
      net/sctp/socket.c
        f866fbc8 ("ipv4: fix data-races around inet->inet_id")
        b09bde5c ("inet: move inet->mc_loop to inet->inet_frags")
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      57ce6427
    • Linus Torvalds's avatar
      Merge tag 'net-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · b5cc3833
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from wifi, can and netfilter.
      
        Fixes to fixes:
      
         - nf_tables:
             - GC transaction race with abort path
             - defer gc run if previous batch is still pending
      
        Previous releases - regressions:
      
         - ipv4: fix data-races around inet->inet_id
      
         - phy: fix deadlocking in phy_error() invocation
      
         - mdio: fix C45 read/write protocol
      
         - ipvlan: fix a reference count leak warning in ipvlan_ns_exit()
      
         - ice: fix NULL pointer deref during VF reset
      
         - i40e: fix potential NULL pointer dereferencing of pf->vf in
           i40e_sync_vsi_filters()
      
         - tg3: use slab_build_skb() when needed
      
         - mtk_eth_soc: fix NULL pointer on hw reset
      
        Previous releases - always broken:
      
         - core: validate veth and vxcan peer ifindexes
      
         - sched: fix a qdisc modification with ambiguous command request
      
         - devlink: add missing unregister linecard notification
      
         - wifi: mac80211: limit reorder_buf_filtered to avoid UBSAN warning
      
         - batman:
            - do not get eth header before batadv_check_management_packet
            - fix batadv_v_ogm_aggr_send memory leak
      
         - bonding: fix macvlan over alb bond support
      
         - mlxsw: set time stamp fields also when its type is MIRROR_UTC"
      
      * tag 'net-6.5-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (54 commits)
        selftests: bonding: add macvlan over bond testing
        selftest: bond: add new topo bond_topo_2d1c.sh
        bonding: fix macvlan over alb bond support
        rtnetlink: Reject negative ifindexes in RTM_NEWLINK
        netfilter: nf_tables: defer gc run if previous batch is still pending
        netfilter: nf_tables: fix out of memory error handling
        netfilter: nf_tables: use correct lock to protect gc_list
        netfilter: nf_tables: GC transaction race with abort path
        netfilter: nf_tables: flush pending destroy work before netlink notifier
        netfilter: nf_tables: validate all pending tables
        ibmveth: Use dcbf rather than dcbfl
        i40e: fix potential NULL pointer dereferencing of pf->vf i40e_sync_vsi_filters()
        net/sched: fix a qdisc modification with ambiguous command request
        igc: Fix the typo in the PTM Control macro
        batman-adv: Hold rtnl lock during MTU update via netlink
        igb: Avoid starting unnecessary workqueues
        can: raw: add missing refcount for memory leak fix
        can: isotp: fix support for transmission of SF without flow control
        bnx2x: new flag for track HW resource allocation
        sfc: allocate a big enough SKB for loopback selftest packet
        ...
      b5cc3833
    • Paolo Abeni's avatar
      Merge tag 'mlx5-updates-2023-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux · 9f6708a6
      Paolo Abeni authored
      Saeed Mahameed says:
      
      ====================
      mlx5-updates-2023-08-22
      
      1) Patches #1..#13 From Jiri:
      
      The goal of this patchset is to make the SF code cleaner.
      
      Benefit from previously introduced devlink_port struct containerization
      to avoid unnecessary lookups in devlink port ops.
      
      Also, benefit from the devlink locking changes and avoid unnecessary
      reference counting.
      
      2) Patches #14,#15:
      
      Add ability to configure proto both UDP and TCP selectors in RX and TX
      directions.
      
      * tag 'mlx5-updates-2023-08-22' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux:
        net/mlx5e: Support IPsec upper TCP protocol selector
        net/mlx5e: Support IPsec upper protocol selector field offload for RX
        net/mlx5: Store vport in struct mlx5_devlink_port and use it in port ops
        net/mlx5: Check vhca_resource_manager capability in each op and add extack msg
        net/mlx5: Relax mlx5_devlink_eswitch_get() return value checking
        net/mlx5: Return -EOPNOTSUPP in mlx5_devlink_port_fn_migratable_set() directly
        net/mlx5: Reduce number of vport lookups passing vport pointer instead of index
        net/mlx5: Embed struct devlink_port into driver structure
        net/mlx5: Don't register ops for non-PF/VF/SF port and avoid checks in ops
        net/mlx5: Remove no longer used mlx5_esw_offloads_sf_vport_enable/disable()
        net/mlx5: Introduce mlx5_eswitch_load/unload_sf_vport() and use it from SF code
        net/mlx5: Allow mlx5_esw_offloads_devlink_port_register() to register SFs
        net/mlx5: Push devlink port PF/VF init/cleanup calls out of devlink_port_register/unregister()
        net/mlx5: Push out SF devlink port init and cleanup code to separate helpers
        net/mlx5: Rework devlink port alloc/free into init/cleanup
      ====================
      
      Link: https://lore.kernel.org/all/20230823051012.162483-1-saeed@kernel.org/Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      9f6708a6
    • Paolo Abeni's avatar
      Merge tag 'nf-23-08-23' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · 8938fc0c
      Paolo Abeni authored
      Florian Westphal says:
      
      ====================
      netfilter updates for net
      
      This PR contains nf_tables updates for your *net* tree.
      
      First patch fixes table validation, I broke this in 6.4 when tracking
      validation state per table, reported by Pablo, fixup from myself.
      
      Second patch makes sure objects waiting for memory release have been
      released, this was broken in 6.1, patch from Pablo Neira Ayuso.
      
      Patch three is a fix-for-fix from previous PR: In case a transaction
      gets aborted, gc sequence counter needs to be incremented so pending
      gc requests are invalidated, from Pablo.
      
      Same for patch 4: gc list needs to use gc list lock, not destroy lock,
      also from Pablo.
      
      Patch 5 fixes a UaF in a set backend, but this should only occur when
      failslab is enabled for GFP_KERNEL allocations, broken since feature
      was added in 5.6, from myself.
      
      Patch 6 fixes a double-free bug that was also added via previous PR:
      We must not schedule gc work if the previous batch is still queued.
      
      netfilter pull request 2023-08-23
      
      * tag 'nf-23-08-23' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        netfilter: nf_tables: defer gc run if previous batch is still pending
        netfilter: nf_tables: fix out of memory error handling
        netfilter: nf_tables: use correct lock to protect gc_list
        netfilter: nf_tables: GC transaction race with abort path
        netfilter: nf_tables: flush pending destroy work before netlink notifier
        netfilter: nf_tables: validate all pending tables
      ====================
      
      Link: https://lore.kernel.org/r/20230823152711.15279-1-fw@strlen.deSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      8938fc0c
    • Paolo Abeni's avatar
      Merge branch 'fix-macvlan-over-alb-bond-support' · b251610c
      Paolo Abeni authored
      Hangbin Liu says:
      
      ====================
      fix macvlan over alb bond support
      
      Currently, the macvlan over alb bond is broken after commit
      14af9963 ("bonding: Support macvlans on top of tlb/rlb mode bonds").
      Fix this and add relate tests.
      ====================
      
      Link: https://lore.kernel.org/r/20230823071907.3027782-1-liuhangbin@gmail.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b251610c
    • Hangbin Liu's avatar
      selftests: bonding: add macvlan over bond testing · 246af950
      Hangbin Liu authored
      Add a macvlan over bonding test with mode active-backup, balance-tlb
      and balance-alb.
      
      ]# ./bond_macvlan.sh
      TEST: active-backup: IPv4: client->server                           [ OK ]
      TEST: active-backup: IPv6: client->server                           [ OK ]
      TEST: active-backup: IPv4: client->macvlan_1                        [ OK ]
      TEST: active-backup: IPv6: client->macvlan_1                        [ OK ]
      TEST: active-backup: IPv4: client->macvlan_2                        [ OK ]
      TEST: active-backup: IPv6: client->macvlan_2                        [ OK ]
      TEST: active-backup: IPv4: macvlan_1->macvlan_2                     [ OK ]
      TEST: active-backup: IPv6: macvlan_1->macvlan_2                     [ OK ]
      TEST: active-backup: IPv4: server->client                           [ OK ]
      TEST: active-backup: IPv6: server->client                           [ OK ]
      TEST: active-backup: IPv4: macvlan_1->client                        [ OK ]
      TEST: active-backup: IPv6: macvlan_1->client                        [ OK ]
      TEST: active-backup: IPv4: macvlan_2->client                        [ OK ]
      TEST: active-backup: IPv6: macvlan_2->client                        [ OK ]
      TEST: active-backup: IPv4: macvlan_2->macvlan_2                     [ OK ]
      TEST: active-backup: IPv6: macvlan_2->macvlan_2                     [ OK ]
      [...]
      TEST: balance-alb: IPv4: client->server                             [ OK ]
      TEST: balance-alb: IPv6: client->server                             [ OK ]
      TEST: balance-alb: IPv4: client->macvlan_1                          [ OK ]
      TEST: balance-alb: IPv6: client->macvlan_1                          [ OK ]
      TEST: balance-alb: IPv4: client->macvlan_2                          [ OK ]
      TEST: balance-alb: IPv6: client->macvlan_2                          [ OK ]
      TEST: balance-alb: IPv4: macvlan_1->macvlan_2                       [ OK ]
      TEST: balance-alb: IPv6: macvlan_1->macvlan_2                       [ OK ]
      TEST: balance-alb: IPv4: server->client                             [ OK ]
      TEST: balance-alb: IPv6: server->client                             [ OK ]
      TEST: balance-alb: IPv4: macvlan_1->client                          [ OK ]
      TEST: balance-alb: IPv6: macvlan_1->client                          [ OK ]
      TEST: balance-alb: IPv4: macvlan_2->client                          [ OK ]
      TEST: balance-alb: IPv6: macvlan_2->client                          [ OK ]
      TEST: balance-alb: IPv4: macvlan_2->macvlan_2                       [ OK ]
      TEST: balance-alb: IPv6: macvlan_2->macvlan_2                       [ OK ]
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      246af950
    • Hangbin Liu's avatar
      selftest: bond: add new topo bond_topo_2d1c.sh · 27aa43f8
      Hangbin Liu authored
      Add a new testing topo bond_topo_2d1c.sh which is used more commonly.
      Make bond_topo_3d1c.sh just source bond_topo_2d1c.sh and add the
      extra link.
      Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      27aa43f8
    • Hangbin Liu's avatar
      bonding: fix macvlan over alb bond support · e74216b8
      Hangbin Liu authored
      The commit 14af9963 ("bonding: Support macvlans on top of tlb/rlb mode
      bonds") aims to enable the use of macvlans on top of rlb bond mode. However,
      the current rlb bond mode only handles ARP packets to update remote neighbor
      entries. This causes an issue when a macvlan is on top of the bond, and
      remote devices send packets to the macvlan using the bond's MAC address
      as the destination. After delivering the packets to the macvlan, the macvlan
      will rejects them as the MAC address is incorrect. Consequently, this commit
      makes macvlan over bond non-functional.
      
      To address this problem, one potential solution is to check for the presence
      of a macvlan port on the bond device using netif_is_macvlan_port(bond->dev)
      and return NULL in the rlb_arp_xmit() function. However, this approach
      doesn't fully resolve the situation when a VLAN exists between the bond and
      macvlan.
      
      So let's just do a partial revert for commit 14af9963 in rlb_arp_xmit().
      As the comment said, Don't modify or load balance ARPs that do not originate
      locally.
      
      Fixes: 14af9963 ("bonding: Support macvlans on top of tlb/rlb mode bonds")
      Reported-by: susan.zheng@veritas.com
      Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2117816Signed-off-by: default avatarHangbin Liu <liuhangbin@gmail.com>
      Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e74216b8
    • Ido Schimmel's avatar
      rtnetlink: Reject negative ifindexes in RTM_NEWLINK · 30188bd7
      Ido Schimmel authored
      Negative ifindexes are illegal, but the kernel does not validate the
      ifindex in the ancillary header of RTM_NEWLINK messages, resulting in
      the kernel generating a warning [1] when such an ifindex is specified.
      
      Fix by rejecting negative ifindexes.
      
      [1]
      WARNING: CPU: 0 PID: 5031 at net/core/dev.c:9593 dev_index_reserve+0x1a2/0x1c0 net/core/dev.c:9593
      [...]
      Call Trace:
       <TASK>
       register_netdevice+0x69a/0x1490 net/core/dev.c:10081
       br_dev_newlink+0x27/0x110 net/bridge/br_netlink.c:1552
       rtnl_newlink_create net/core/rtnetlink.c:3471 [inline]
       __rtnl_newlink+0x115e/0x18c0 net/core/rtnetlink.c:3688
       rtnl_newlink+0x67/0xa0 net/core/rtnetlink.c:3701
       rtnetlink_rcv_msg+0x439/0xd30 net/core/rtnetlink.c:6427
       netlink_rcv_skb+0x16b/0x440 net/netlink/af_netlink.c:2545
       netlink_unicast_kernel net/netlink/af_netlink.c:1342 [inline]
       netlink_unicast+0x536/0x810 net/netlink/af_netlink.c:1368
       netlink_sendmsg+0x93c/0xe40 net/netlink/af_netlink.c:1910
       sock_sendmsg_nosec net/socket.c:728 [inline]
       sock_sendmsg+0xd9/0x180 net/socket.c:751
       ____sys_sendmsg+0x6ac/0x940 net/socket.c:2538
       ___sys_sendmsg+0x135/0x1d0 net/socket.c:2592
       __sys_sendmsg+0x117/0x1e0 net/socket.c:2621
       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
      
      Fixes: 38f7b870 ("[RTNETLINK]: Link creation API")
      Reported-by: syzbot+5ba06978f34abb058571@syzkaller.appspotmail.com
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Link: https://lore.kernel.org/r/20230823064348.2252280-1-idosch@nvidia.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      30188bd7
    • Jakub Kicinski's avatar
      Merge branch 'net-ethernet-mtk_eth_soc-improve-support-for-mt7988' · 23c167af
      Jakub Kicinski authored
      Daniel Golle says:
      
      ====================
      net: ethernet: mtk_eth_soc: improve support for MT7988
      
      This series fixes and completes commit 445eb644 ("net: ethernet:
      mtk_eth_soc: add basic support for MT7988 SoC") and also adds support
      for using the in-SoC SRAM to previous MT7986 and MT7981 SoCs.
      ====================
      
      Link: https://lore.kernel.org/r/cover.1692721443.git.daniel@makrotopia.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      23c167af
    • Daniel Golle's avatar
      net: ethernet: mtk_eth_soc: support 36-bit DMA addressing on MT7988 · 2d75891e
      Daniel Golle authored
      Systems having 4 GiB of RAM and more require DMA addressing beyond the
      current 32-bit limit. Starting from MT7988 the hardware now supports
      36-bit DMA addressing, let's use that new capability in the driver to
      avoid running into swiotlb on systems with 4 GiB of RAM or more.
      Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Link: https://lore.kernel.org/r/95b919c98876c9e49761e44662e7c937479eecb8.1692721443.git.daniel@makrotopia.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2d75891e
    • Daniel Golle's avatar
      net: ethernet: mtk_eth_soc: add support for in-SoC SRAM · ebb1e4f9
      Daniel Golle authored
      MT7981, MT7986 and MT7988 come with in-SoC SRAM dedicated for Ethernet
      DMA rings. Support using the SRAM without breaking existing device tree
      bindings, ie. only new SoC starting from MT7988 will have the SRAM
      declared as additional resource in device tree. For MT7981 and MT7986
      an offset on top of the main I/O base is used.
      Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Link: https://lore.kernel.org/r/e45e0f230c63ad58869e8fe35b95a2fb8925b625.1692721443.git.daniel@makrotopia.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ebb1e4f9
    • Daniel Golle's avatar
      net: ethernet: mtk_eth_soc: add reset bits for MT7988 · 88c1e6ef
      Daniel Golle authored
      Add bits needed to reset the frame engine on MT7988.
      
      Fixes: 445eb644 ("net: ethernet: mtk_eth_soc: add basic support for MT7988 SoC")
      Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Link: https://lore.kernel.org/r/89b6c38380e7a3800c1362aa7575600717bc7543.1692721443.git.daniel@makrotopia.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      88c1e6ef
    • Daniel Golle's avatar
      net: ethernet: mtk_eth_soc: fix register definitions for MT7988 · cfb5677d
      Daniel Golle authored
      More register macros need to be adjusted for the 3rd GMAC on MT7988.
      Account for added bit in SYSCFG0_SGMII_MASK.
      
      Fixes: 445eb644 ("net: ethernet: mtk_eth_soc: add basic support for MT7988 SoC")
      Signed-off-by: default avatarDaniel Golle <daniel@makrotopia.org>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/1c8da012e2ca80939906d85f314138c552139f0f.1692721443.git.daniel@makrotopia.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      cfb5677d
    • Wei Fang's avatar
      net: fec: add exception tracing for XDP · e83fabb7
      Wei Fang authored
      As we already added the exception tracing for XDP_TX, I think it is
      necessary to add the exception tracing for other XDP actions, such
      as XDP_REDIRECT, XDP_ABORTED and unknown error actions.
      Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
      Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
      Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Link: https://lore.kernel.org/r/20230822065255.606739-1-wei.fang@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      e83fabb7
    • Yu Liao's avatar
      net: dm9051: Use PTR_ERR_OR_ZERO() to simplify code · 664c84c2
      Yu Liao authored
      Use the standard error pointer macro to shorten the code and simplify.
      Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
      Link: https://lore.kernel.org/r/20230822021455.205101-2-liaoyu15@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      664c84c2
  2. 23 Aug, 2023 16 commits