1. 05 Feb, 2024 5 commits
    • David Howells's avatar
      rxrpc: Fix generation of serial numbers to skip zero · f3104141
      David Howells authored
      In the Rx protocol, every packet generated is marked with a per-connection
      monotonically increasing serial number.  This number can be referenced in
      an ACK packet generated in response to an incoming packet - thereby
      allowing the sender to use this for RTT determination, amongst other
      things.
      
      However, if the reference field in the ACK is zero, it doesn't refer to any
      incoming packet (it could be a ping to find out if a packet got lost, for
      example) - so we shouldn't generate zero serial numbers.
      
      Fix the generation of serial numbers to retry if it comes up with a zero.
      
      Furthermore, since the serial numbers are only ever allocated within the
      I/O thread this connection is bound to, there's no need for atomics so
      remove that too.
      
      Fixes: 17926a79 ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Marc Dionne <marc.dionne@auristor.com>
      cc: "David S. Miller" <davem@davemloft.net>
      cc: Eric Dumazet <edumazet@google.com>
      cc: Jakub Kicinski <kuba@kernel.org>
      cc: Paolo Abeni <pabeni@redhat.com>
      cc: linux-afs@lists.infradead.org
      cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f3104141
    • David S. Miller's avatar
      Merge branch 'nfp-fixes' · fdeba0b5
      David S. Miller authored
      Louis Peens says:
      
      ====================
      nfp: a few simple driver fixes
      
      This is combining a few unrelated one-liner fixes which have been
      floating around internally into a single series. I'm not sure what is
      the least amount of overhead for reviewers, this or a separate
      submission per-patch? I guess it probably depends on personal
      preference, but please let me know if there is a strong preference to
      rather split these in the future.
      
      Summary:
      
      Patch1: Fixes an old issue which was hidden because 0 just so happens to
              be the correct value.
      Patch2: Fixes a corner case for flower offloading with bond ports
      Patch3: Re-enables the 'NETDEV_XDP_ACT_REDIRECT', which was accidentally
              disabled after a previous refactor.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fdeba0b5
    • James Hershaw's avatar
      nfp: enable NETDEV_XDP_ACT_REDIRECT feature flag · 0f4d6f01
      James Hershaw authored
      Enable previously excluded xdp feature flag for NFD3 devices. This
      feature flag is required in order to bind nfp interfaces to an xdp
      socket and the nfp driver does in fact support the feature.
      
      Fixes: 66c0e13a ("drivers: net: turn on XDP features")
      Cc: stable@vger.kernel.org # 6.3+
      Signed-off-by: default avatarJames Hershaw <james.hershaw@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f4d6f01
    • Daniel de Villiers's avatar
      nfp: flower: prevent re-adding mac index for bonded port · 1a1c1330
      Daniel de Villiers authored
      When physical ports are reset (either through link failure or manually
      toggled down and up again) that are slaved to a Linux bond with a tunnel
      endpoint IP address on the bond device, not all tunnel packets arriving
      on the bond port are decapped as expected.
      
      The bond dev assigns the same MAC address to itself and each of its
      slaves. When toggling a slave device, the same MAC address is therefore
      offloaded to the NFP multiple times with different indexes.
      
      The issue only occurs when re-adding the shared mac. The
      nfp_tunnel_add_shared_mac() function has a conditional check early on
      that checks if a mac entry already exists and if that mac entry is
      global: (entry && nfp_tunnel_is_mac_idx_global(entry->index)). In the
      case of a bonded device (For example br-ex), the mac index is obtained,
      and no new index is assigned.
      
      We therefore modify the conditional in nfp_tunnel_add_shared_mac() to
      check if the port belongs to the LAG along with the existing checks to
      prevent a new global mac index from being re-assigned to the slave port.
      
      Fixes: 20cce886 ("nfp: flower: enable MAC address sharing for offloadable devs")
      CC: stable@vger.kernel.org # 5.1+
      Signed-off-by: default avatarDaniel de Villiers <daniel.devilliers@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a1c1330
    • Daniel Basilio's avatar
      nfp: use correct macro for LengthSelect in BAR config · b3d4f7f2
      Daniel Basilio authored
      The 1st and 2nd expansion BAR configuration registers are configured,
      when the driver starts up, in variables 'barcfg_msix_general' and
      'barcfg_msix_xpb', respectively. The 'LengthSelect' field is ORed in
      from bit 0, which is incorrect. The 'LengthSelect' field should
      start from bit 27.
      
      This has largely gone un-noticed because
      NFP_PCIE_BAR_PCIE2CPP_LengthSelect_32BIT happens to be 0.
      
      Fixes: 4cb584e0 ("nfp: add CPP access core")
      Cc: stable@vger.kernel.org # 4.11+
      Signed-off-by: default avatarDaniel Basilio <daniel.basilio@corigine.com>
      Signed-off-by: default avatarLouis Peens <louis.peens@corigine.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3d4f7f2
  2. 04 Feb, 2024 2 commits
  3. 03 Feb, 2024 10 commits
  4. 02 Feb, 2024 3 commits
    • Eric Dumazet's avatar
      netdevsim: avoid potential loop in nsim_dev_trap_report_work() · ba5e1272
      Eric Dumazet authored
      Many syzbot reports include the following trace [1]
      
      If nsim_dev_trap_report_work() can not grab the mutex,
      it should rearm itself at least one jiffie later.
      
      [1]
      Sending NMI from CPU 1 to CPUs 0:
      NMI backtrace for cpu 0
      CPU: 0 PID: 32383 Comm: kworker/0:2 Not tainted 6.8.0-rc2-syzkaller-00031-g861c0981 #0
      Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
      Workqueue: events nsim_dev_trap_report_work
       RIP: 0010:bytes_is_nonzero mm/kasan/generic.c:89 [inline]
       RIP: 0010:memory_is_nonzero mm/kasan/generic.c:104 [inline]
       RIP: 0010:memory_is_poisoned_n mm/kasan/generic.c:129 [inline]
       RIP: 0010:memory_is_poisoned mm/kasan/generic.c:161 [inline]
       RIP: 0010:check_region_inline mm/kasan/generic.c:180 [inline]
       RIP: 0010:kasan_check_range+0x101/0x190 mm/kasan/generic.c:189
      Code: 07 49 39 d1 75 0a 45 3a 11 b8 01 00 00 00 7c 0b 44 89 c2 e8 21 ed ff ff 83 f0 01 5b 5d 41 5c c3 48 85 d2 74 4f 48 01 ea eb 09 <48> 83 c0 01 48 39 d0 74 41 80 38 00 74 f2 eb b6 41 bc 08 00 00 00
      RSP: 0018:ffffc90012dcf998 EFLAGS: 00000046
      RAX: fffffbfff258af1e RBX: fffffbfff258af1f RCX: ffffffff8168eda3
      RDX: fffffbfff258af1f RSI: 0000000000000004 RDI: ffffffff92c578f0
      RBP: fffffbfff258af1e R08: 0000000000000000 R09: fffffbfff258af1e
      R10: ffffffff92c578f3 R11: ffffffff8acbcbc0 R12: 0000000000000002
      R13: ffff88806db38400 R14: 1ffff920025b9f42 R15: ffffffff92c578e8
      FS:  0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 000000c00994e078 CR3: 000000002c250000 CR4: 00000000003506f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       <NMI>
       </NMI>
       <TASK>
        instrument_atomic_read include/linux/instrumented.h:68 [inline]
        atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
        queued_spin_is_locked include/asm-generic/qspinlock.h:57 [inline]
        debug_spin_unlock kernel/locking/spinlock_debug.c:101 [inline]
        do_raw_spin_unlock+0x53/0x230 kernel/locking/spinlock_debug.c:141
        __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:150 [inline]
        _raw_spin_unlock_irqrestore+0x22/0x70 kernel/locking/spinlock.c:194
        debug_object_activate+0x349/0x540 lib/debugobjects.c:726
        debug_work_activate kernel/workqueue.c:578 [inline]
        insert_work+0x30/0x230 kernel/workqueue.c:1650
        __queue_work+0x62e/0x11d0 kernel/workqueue.c:1802
        __queue_delayed_work+0x1bf/0x270 kernel/workqueue.c:1953
        queue_delayed_work_on+0x106/0x130 kernel/workqueue.c:1989
        queue_delayed_work include/linux/workqueue.h:563 [inline]
        schedule_delayed_work include/linux/workqueue.h:677 [inline]
        nsim_dev_trap_report_work+0x9c0/0xc80 drivers/net/netdevsim/dev.c:842
        process_one_work+0x886/0x15d0 kernel/workqueue.c:2633
        process_scheduled_works kernel/workqueue.c:2706 [inline]
        worker_thread+0x8b9/0x1290 kernel/workqueue.c:2787
        kthread+0x2c6/0x3a0 kernel/kthread.c:388
        ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
        ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
       </TASK>
      
      Fixes: 012ec02a ("netdevsim: convert driver to use unlocked devlink API during init/fini")
      Reported-by: default avatarsyzbot <syzkaller@googlegroups.com>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20240201175324.3752746-1-edumazet@google.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ba5e1272
    • Michael Lass's avatar
      net: Fix from address in memcpy_to_iter_csum() · fe92f874
      Michael Lass authored
      While inlining csum_and_memcpy() into memcpy_to_iter_csum(), the from
      address passed to csum_partial_copy_nocheck() was accidentally changed.
      This causes a regression in applications using UDP, as for example
      OpenAFS, causing loss of datagrams.
      
      Fixes: dc32bff1 ("iov_iter, net: Fold in csum_and_memcpy()")
      Cc: David Howells <dhowells@redhat.com>
      Cc: stable@vger.kernel.org
      Cc: regressions@lists.linux.dev
      Signed-off-by: default avatarMichael Lass <bevan@bi-co.net>
      Reviewed-by: default avatarJeffrey Altman <jaltman@auristor.com>
      Acked-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fe92f874
    • Furong Xu's avatar
      net: stmmac: xgmac: fix handling of DPP safety error for DMA channels · 46eba193
      Furong Xu authored
      Commit 56e58d6c ("net: stmmac: Implement Safety Features in
      XGMAC core") checks and reports safety errors, but leaves the
      Data Path Parity Errors for each channel in DMA unhandled at all, lead to
      a storm of interrupt.
      Fix it by checking and clearing the DMA_DPP_Interrupt_Status register.
      
      Fixes: 56e58d6c ("net: stmmac: Implement Safety Features in XGMAC core")
      Signed-off-by: default avatarFurong Xu <0x1207@gmail.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46eba193
  5. 01 Feb, 2024 20 commits