Skip to content
  1. Nov 30, 2023
    • John Fastabend's avatar
      bpf, sockmap: af_unix stream sockets need to hold ref for pair sock · 8866730a
      John Fastabend authored
      AF_UNIX stream sockets are a paired socket. So sending on one of the pairs
      will lookup the paired socket as part of the send operation. It is possible
      however to put just one of the pairs in a BPF map. This currently increments
      the refcnt on the sock in the sockmap to ensure it is not free'd by the
      stack before sockmap cleans up its state and stops any skbs being sent/recv'd
      to that socket.
      
      But we missed a case. If the peer socket is closed it will be free'd by the
      stack. However, the paired socket can still be referenced from BPF sockmap
      side because we hold a reference there. Then if we are sending traffic through
      BPF sockmap to that socket it will try to dereference the free'd pair in its
      send logic creating a use after free. And following splat:
      
         [59.900375] BUG: KASAN: slab-use-after-free in sk_wake_async+0x31/0x1b0
         [59.901211] Read of size 8 at addr ffff88811acbf060 by task kworker/1:2/954
         [...]
         [59.905468] Call Trace:
         [59.905787]  <TASK>
         [59.906066]  dump_stack_lvl+0x130/0x1d0
         [59.908877]  print_report+0x16f/0x740
         [59.910629]  kasan_report+0x118/0x160
         [59.912576]  sk_wake_async+0x31/0x1b0
         [59.913554]  sock_def_readable+0x156/0x2a0
         [59.914060]  unix_stream_sendmsg+0x3f9/0x12a0
         [59.916398]  sock_sendmsg+0x20e/0x250
         [59.916854]  skb_send_sock+0x236/0xac0
         [59.920527]  sk_psock_backlog+0x287/0xaa0
      
      To fix let BPF sockmap hold a refcnt on both the socket in the sockmap and its
      paired socket. It wasn't obvious how to contain the fix to bpf_unix logic. The
      primarily problem with keeping this logic in bpf_unix was: In the sock close()
      we could handle the deref by having a close handler. But, when we are destroying
      the psock through a map delete operation we wouldn't have gotten any signal
      thorugh the proto struct other than it being replaced. If we do the deref from
      the proto replace its too early because we need to deref the sk_pair after the
      backlog worker has been stopped.
      
      Given all this it seems best to just cache it at the end of the psock and eat 8B
      for the af_unix and vsock users. Notice dgram sockets are OK because they handle
      locking already.
      
      Fixes: 94531cfc
      
       ("af_unix: Add unix_stream_proto for sockmap")
      Signed-off-by: default avatarJohn Fastabend <john.fastabend@gmail.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Reviewed-by: default avatarJakub Sitnicki <jakub@cloudflare.com>
      Link: https://lore.kernel.org/bpf/20231129012557.95371-2-john.fastabend@gmail.com
      8866730a
  2. Nov 28, 2023
  3. Nov 27, 2023
  4. Nov 24, 2023
  5. Nov 23, 2023
    • Paolo Abeni's avatar
      Merge branch 'ice-restore-timestamp-config-after-reset' · e50a8061
      Paolo Abeni authored
      Tony Nguyen says:
      
      ====================
      ice: restore timestamp config after reset
      
      Jake Keller says:
      
      We recently discovered during internal validation that the ice driver has
      not been properly restoring Tx timestamp configuration after a device reset,
      which resulted in application failures after a device reset.
      
      After some digging, it turned out this problem is two-fold. Since the
      introduction of the PTP support the driver has been clobbering the storage
      of the current timestamp configuration during reset. Thus after a reset, the
      driver will no longer perform Tx or Rx timestamps, and will report
      timestamp configuration as disabled if SIOCGHWTSTAMP ioctl is issued.
      
      In addition, the recently merged auxiliary bus support code missed that
      PFINT_TSYN_MSK must be reprogrammed on the clock owner for E822 devices.
      Failure to restore this register configuration results in the driver no
      longer responding to interrupts from other ports. Depending on the traffic
      pattern, this can either result in increased latency responding to
      timestamps on the non-owner ports, or it can result in the driver never
      reporting any timestamps. The configuration of PFINT_TSYN_MSK was only done
      during initialization. Due to this, the Tx timestamp issue persists even if
      userspace reconfigures timestamping.
      
      This series fixes both issues, as well as removes a redundant Tx ring field
      since we can rely on the skb flag as the primary detector for a Tx timestamp
      request.
      
      Note that I don't think this series will directly apply to older stable
      releases (even v6.6) as we recently refactored a lot of the PTP code to
      support auxiliary bus. Patch 2/3 only matters for the post-auxiliary bus
      implementation. The principle of patch 1/3 and 3/3 could apply as far back
      as the initial PTP support, but I don't think it will apply cleanly as-is.
      ====================
      
      Link: https://lore.kernel.org/r/20231121211259.3348630-1-anthony.l.nguyen@intel.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      e50a8061
    • Jacob Keller's avatar
      ice: restore timestamp configuration after device reset · 77580179
      Jacob Keller authored
      The driver calls ice_ptp_cfg_timestamp() during ice_ptp_prepare_for_reset()
      to disable timestamping while the device is resetting. This operation
      destroys the user requested configuration. While the driver does call
      ice_ptp_cfg_timestamp in ice_rebuild() to restore some hardware settings
      after a reset, it unconditionally passes true or false, resulting in
      failure to restore previous user space configuration.
      
      This results in a device reset forcibly disabling timestamp configuration
      regardless of current user settings.
      
      This was not detected previously due to a quirk of the LinuxPTP ptp4l
      application. If ptp4l detects a missing timestamp, it enters a fault state
      and performs recovery logic which includes executing SIOCSHWTSTAMP again,
      restoring the now accidentally cleared configuration.
      
      Not every application does this, and for these applications, timestamps
      will mysteriously stop after a PF reset, without being restored until an
      application restart.
      
      Fix this by replacing ice_ptp_cfg_timestamp() with two new functions:
      
      1) ice_ptp_disable_timestamp_mode() which unconditionally disables the
         timestamping logic in ice_ptp_prepare_for_reset() and ice_ptp_release()
      
      2) ice_ptp_restore_timestamp_mode() which calls
         ice_ptp_restore_tx_interrupt() to restore Tx timestamping configuration,
         calls ice_set_rx_tstamp() to restore Rx timestamping configuration, and
         issues an immediate TSYN_TX interrupt to ensure that timestamps which
         may have occurred during the device reset get processed.
      
      Modify the ice_ptp_set_timestamp_mode to directly save the user
      configuration and then call ice_ptp_restore_timestamp_mode. This way, reset
      no longer destroys the saved user configuration.
      
      This obsoletes the ice_set_tx_tstamp() function which can now be safely
      removed.
      
      With this change, all devices should now restore Tx and Rx timestamping
      functionality correctly after a PF reset without application intervention.
      
      Fixes: 77a78115 ("ice: enable receive hardware timestamping")
      Fixes: ea9b847c
      
       ("ice: enable transmit timestamps for E810 devices")
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-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 avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      77580179
    • Jacob Keller's avatar
      ice: unify logic for programming PFINT_TSYN_MSK · 7d606a1e
      Jacob Keller authored
      Commit d938a8cc ("ice: Auxbus devices & driver for E822 TS") modified
      how Tx timestamps are handled for E822 devices. On these devices, only the
      clock owner handles reading the Tx timestamp data from firmware. To do
      this, the PFINT_TSYN_MSK register is modified from the default value to one
      which enables reacting to a Tx timestamp on all PHY ports.
      
      The driver currently programs PFINT_TSYN_MSK in different places depending
      on whether the port is the clock owner or not. For the clock owner, the
      PFINT_TSYN_MSK value is programmed during ice_ptp_init_owner just before
      calling ice_ptp_tx_ena_intr to program the PHY ports.
      
      For the non-clock owner ports, the PFINT_TSYN_MSK is programmed during
      ice_ptp_init_port.
      
      If a large enough device reset occurs, the PFINT_TSYN_MSK register will be
      reset to the default value in which only the PHY associated directly with
      the PF will cause the Tx timestamp interrupt to trigger.
      
      The driver lacks logic to reprogram the PFINT_TSYN_MSK register after a
      device reset. For the E822 device, this results in the PF no longer
      responding to interrupts for other ports. This results in failure to
      deliver Tx timestamps to user space applications.
      
      Rename ice_ptp_configure_tx_tstamp to ice_ptp_cfg_tx_interrupt, and unify
      the logic for programming PFINT_TSYN_MSK and PFINT_OICR_ENA into one place.
      This function will program both registers according to the combination of
      user configuration and device requirements.
      
      This ensures that PFINT_TSYN_MSK is always restored when we configure the
      Tx timestamp interrupt.
      
      Fixes: d938a8cc
      
       ("ice: Auxbus devices & driver for E822 TS")
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-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 avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7d606a1e
    • Jacob Keller's avatar
      ice: remove ptp_tx ring parameter flag · 0ffb08b1
      Jacob Keller authored
      Before performing a Tx timestamp in ice_stamp(), the driver checks a ptp_tx
      ring variable to see if timestamping is enabled on that ring. This value is
      set for all rings whenever userspace configures Tx timestamping.
      
      Ostensibly this was done to avoid wasting cycles checking other fields when
      timestamping has not been enabled. However, for Tx timestamps we already
      get an individual per-SKB flag indicating whether userspace wants to
      request a timestamp on that packet. We do not gain much by also having
      a separate flag to check for whether timestamping was enabled.
      
      In fact, the driver currently fails to restore the field after a PF reset.
      Because of this, if a PF reset occurs, timestamps will be disabled.
      
      Since this flag doesn't add value in the hotpath, remove it and always
      provide a timestamp if the SKB flag has been set.
      
      A following change will fix the reset path to properly restore user
      timestamping configuration completely.
      
      This went unnoticed for some time because one of the most common
      applications using Tx timestamps, ptp4l, will reconfigure the socket as
      part of its fault recovery logic.
      
      Fixes: ea9b847c
      
       ("ice: enable transmit timestamps for E810 devices")
      Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
      Reviewed-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 avatarTony Nguyen <anthony.l.nguyen@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      0ffb08b1
    • Paolo Abeni's avatar
      Merge branch 'amd-xgbe-fixes-to-handle-corner-cases' · d9775fb6
      Paolo Abeni authored
      Raju Rangoju says:
      
      ====================
      amd-xgbe: fixes to handle corner-cases
      
      This series include bug fixes to amd-xgbe driver.
      ====================
      
      Link: https://lore.kernel.org/r/20231121191435.4049995-1-Raju.Rangoju@amd.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      d9775fb6
    • Raju Rangoju's avatar
      amd-xgbe: propagate the correct speed and duplex status · 7a2323ac
      Raju Rangoju authored
      xgbe_get_link_ksettings() does not propagate correct speed and duplex
      information to ethtool during cable unplug. Due to which ethtool reports
      incorrect values for speed and duplex.
      
      Address this by propagating correct information.
      
      Fixes: 7c12aa08
      
       ("amd-xgbe: Move the PHY support into amd-xgbe")
      Acked-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7a2323ac
    • Raju Rangoju's avatar
      amd-xgbe: handle the corner-case during tx completion · 7121205d
      Raju Rangoju authored
      The existing implementation uses software logic to accumulate tx
      completions until the specified time (1ms) is met and then poll them.
      However, there exists a tiny gap which leads to a race between
      resetting and checking the tx_activate flag. Due to this the tx
      completions are not reported to upper layer and tx queue timeout
      kicks-in restarting the device.
      
      To address this, introduce a tx cleanup mechanism as part of the
      periodic maintenance process.
      
      Fixes: c5aa9e3b
      
       ("amd-xgbe: Initial AMD 10GbE platform driver")
      Acked-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      7121205d
    • Raju Rangoju's avatar
      amd-xgbe: handle corner-case during sfp hotplug · 676ec538
      Raju Rangoju authored
      Force the mode change for SFI in Fixed PHY configurations. Fixed PHY
      configurations needs PLL to be enabled while doing mode set. When the
      SFP module isn't connected during boot, driver assumes AN is ON and
      attempts auto-negotiation. However, if the connected SFP comes up in
      Fixed PHY configuration the link will not come up as PLL isn't enabled
      while the initial mode set command is issued. So, force the mode change
      for SFI in Fixed PHY configuration to fix link issues.
      
      Fixes: e57f7a3f
      
       ("amd-xgbe: Prepare for working with more than one type of phy")
      Acked-by: default avatarShyam Sundar S K <Shyam-sundar.S-k@amd.com>
      Signed-off-by: default avatarRaju Rangoju <Raju.Rangoju@amd.com>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      676ec538
    • Lorenzo Bianconi's avatar
      net: veth: fix ethtool stats reporting · 818ad9cc
      Lorenzo Bianconi authored
      Fix a possible misalignment between page_pool stats and tx xdp_stats
      reported in veth_get_ethtool_stats routine.
      The issue can be reproduced configuring the veth pair with the
      following tx/rx queues:
      
      $ip link add v0 numtxqueues 2 numrxqueues 4 type veth peer name v1 \
       numtxqueues 1 numrxqueues 1
      
      and loading a simple XDP program on v0 that just returns XDP_PASS.
      In this case on v0 the page_pool stats overwrites tx xdp_stats for queue 1.
      Fix the issue incrementing pp_idx of dev->real_num_tx_queues * VETH_TQ_STATS_LEN
      since we always report xdp_stats for all tx queues in ethtool.
      
      Fixes: 4fc41805
      
       ("net: veth: add page_pool stats")
      Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
      Link: https://lore.kernel.org/r/c5b5d0485016836448453f12846c7c4ab75b094a.1700593593.git.lorenzo@kernel.org
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      818ad9cc
    • Suman Ghosh's avatar
      octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF · 4aa1d8f8
      Suman Ghosh authored
      It is possible to add a ntuple rule which would like to direct packet to
      a VF whose number of queues are greater/less than its PF's queue numbers.
      For example a PF can have 2 Rx queues but a VF created on that PF can have
      8 Rx queues. As of today, ntuple rule will reject rule because it is
      checking the requested queue number against PF's number of Rx queues.
      As a part of this fix if the action of a ntuple rule is to move a packet
      to a VF's queue then the check is removed. Also, a debug information is
      printed to aware user that it is user's responsibility to cross check if
      the requested queue number on that VF is a valid one.
      
      Fixes: f0a1913f
      
       ("octeontx2-pf: Add support for ethtool ntuple filters")
      Signed-off-by: default avatarSuman Ghosh <sumang@marvell.com>
      Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
      Reviewed-by: default avatarSimon Horman <horms@kernel.org>
      Link: https://lore.kernel.org/r/20231121165624.3664182-1-sumang@marvell.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      4aa1d8f8
    • Lech Perczak's avatar
      net: usb: qmi_wwan: claim interface 4 for ZTE MF290 · 99360d96
      Lech Perczak authored
      
      
      Interface 4 is used by for QMI interface in stock firmware of MF28D, the
      router which uses MF290 modem. Rebind it to qmi_wwan after freeing it up
      from option driver.
      The proper configuration is:
      
      Interface mapping is:
      0: QCDM, 1: (unknown), 2: AT (PCUI), 2: AT (Modem), 4: QMI
      
      T:  Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  4 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
      P:  Vendor=19d2 ProdID=0189 Rev= 0.00
      S:  Manufacturer=ZTE, Incorporated
      S:  Product=ZTE LTE Technologies MSM
      C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
      I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
      E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
      E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
      
      Cc: Bjørn Mork <bjorn@mork.no>
      Signed-off-by: default avatarLech Perczak <lech.perczak@gmail.com>
      Link: https://lore.kernel.org/r/20231117231918.100278-3-lech.perczak@gmail.com
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      99360d96
    • Linus Torvalds's avatar
      Merge tag 'loongarch-fixes-6.7-1' of... · 9b6de136
      Linus Torvalds authored
      Merge tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
      
      Pull LoongArch fixes from Huacai Chen:
       "Fix several build errors, a potential kernel panic, a cpu hotplug
        issue and update links in documentations"
      
      * tag 'loongarch-fixes-6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
        Docs/zh_CN/LoongArch: Update links in LoongArch introduction.rst
        Docs/LoongArch: Update links in LoongArch introduction.rst
        LoongArch: Implement constant timer shutdown interface
        LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL
        LoongArch: Silence the boot warning about 'nokaslr'
        LoongArch: Add __percpu annotation for __percpu_read()/__percpu_write()
        LoongArch: Record pc instead of offset in la_abs relocation
        LoongArch: Explicitly set -fdirect-access-external-data for vmlinux
        LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi
      9b6de136
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20231121' of... · 05c8c94e
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20231121' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - One fix for the KVP daemon (Ani Sinha)
      
       - Fix for the detection of E820_TYPE_PRAM in a Gen2 VM (Saurabh Sengar)
      
       - Micro-optimization for hv_nmi_unknown() (Uros Bizjak)
      
      * tag 'hyperv-fixes-signed-20231121' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown()
        x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM
        hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles
      05c8c94e
    • Linus Torvalds's avatar
      asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation · 125b0bb9
      Linus Torvalds authored
      We really don't want to do atomic_read() or anything like that, since we
      already have the value, not the lock.  The whole point of this is that
      we've loaded the lock from memory, and we want to check whether the
      value we loaded was a locked one or not.
      
      The main use of this is the lockref code, which loads both the lock and
      the reference count in one atomic operation, and then works on that
      combined value.  With the atomic_read(), the compiler would pointlessly
      spill the value to the stack, in order to then be able to read it back
      "atomically".
      
      This is the qspinlock version of commit c6f4a900 ("asm-generic:
      ticket-lock: Optimize arch_spin_value_unlocked()") which fixed this same
      bug for ticket locks.
      
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Waiman Long <longman@redhat.com>
      Link: https://lore.kernel.org/all/CAHk-=whNRv0v6kQiV5QO6DJhjH4KEL36vWQ6Re8Csrnh4zbRkQ@mail.gmail.com/
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      125b0bb9
  6. Nov 22, 2023
    • Heiner Kallweit's avatar
      Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" · 6a263102
      Heiner Kallweit authored
      This reverts commit efa5f131
      
      .
      
      I couldn't reproduce the reported issue. What I did, based on a pcap
      packet log provided by the reporter:
      - Used same chip version (RTL8168h)
      - Set MAC address to the one used on the reporters system
      - Replayed the EAPOL unicast packet that, according to the reporter,
        was filtered out by the mc filter.
      The packet was properly received.
      
      Therefore the root cause of the reported issue seems to be somewhere
      else. Disabling mc filtering completely for the most common chip
      version is a quite big hammer. Therefore revert the change and wait
      for further analysis results from the reporter.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a263102
    • D. Wythe's avatar
      net/smc: avoid data corruption caused by decline · e6d71b43
      D. Wythe authored
      We found a data corruption issue during testing of SMC-R on Redis
      applications.
      
      The benchmark has a low probability of reporting a strange error as
      shown below.
      
      "Error: Protocol error, got "\xe2" as reply type byte"
      
      Finally, we found that the retrieved error data was as follows:
      
      0xE2 0xD4 0xC3 0xD9 0x04 0x00 0x2C 0x20 0xA6 0x56 0x00 0x16 0x3E 0x0C
      0xCB 0x04 0x02 0x01 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00
      0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xE2
      
      It is quite obvious that this is a SMC DECLINE message, which means that
      the applications received SMC protocol message.
      We found that this was caused by the following situations:
      
      client                  server
              ¦  clc proposal
              ------------->
              ¦  clc accept
              <-------------
              ¦  clc confirm
              ------------->
      wait llc confirm
      			send llc confirm
              ¦failed llc confirm
              ¦   x------
      (after 2s)timeout
                              wait llc confirm rsp
      
      wait decline
      
      (after 1s) timeout
                              (after 2s) timeout
              ¦   decline
              -------------->
              ¦   decline
              <--------------
      
      As a result, a decline message was sent in the implementation, and this
      message was read from TCP by the already-fallback connection.
      
      This patch double the client timeout as 2x of the server value,
      With this simple change, the Decline messages should never cross or
      collide (during Confirm link timeout).
      
      This issue requires an immediate solution, since the protocol updates
      involve a more long-term solution.
      
      Fixes: 0fb0b02b
      
       ("net/smc: adapt SMC client code to use the LLC flow")
      Signed-off-by: default avatarD. Wythe <alibuda@linux.alibaba.com>
      Reviewed-by: default avatarWen Gu <guwen@linux.alibaba.com>
      Reviewed-by: default avatarWenjia Zhang <wenjia@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e6d71b43
    • Nguyen Dinh Phi's avatar
      nfc: virtual_ncidev: Add variable to check if ndev is running · 84d2db91
      Nguyen Dinh Phi authored
      
      
      syzbot reported an memory leak that happens when an skb is add to
      send_buff after virtual nci closed.
      This patch adds a variable to track if the ndev is running before
      handling new skb in send function.
      
      Signed-off-by: default avatarNguyen Dinh Phi <phind.uet@gmail.com>
      Reported-by: default avatar <syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com>
      Closes: https://lore.kernel.org/lkml/00000000000075472b06007df4fb@google.com
      
      
      Reviewed-by: Bongsu Jeon
      Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84d2db91
    • Uros Bizjak's avatar
      x86/hyperv: Use atomic_try_cmpxchg() to micro-optimize hv_nmi_unknown() · 18286883
      Uros Bizjak authored
      
      
      Use atomic_try_cmpxchg() instead of atomic_cmpxchg(*ptr, old, new) == old
      in hv_nmi_unknown(). On x86 the CMPXCHG instruction returns success in
      the ZF flag, so this change saves a compare after CMPXCHG. The generated
      asm code improves from:
      
        3e:	65 8b 15 00 00 00 00 	mov    %gs:0x0(%rip),%edx
        45:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
        4a:	f0 0f b1 15 00 00 00 	lock cmpxchg %edx,0x0(%rip)
        51:	00
        52:	83 f8 ff             	cmp    $0xffffffff,%eax
        55:	0f 95 c0             	setne  %al
      
      to:
      
        3e:	65 8b 15 00 00 00 00 	mov    %gs:0x0(%rip),%edx
        45:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
        4a:	f0 0f b1 15 00 00 00 	lock cmpxchg %edx,0x0(%rip)
        51:	00
        52:	0f 95 c0             	setne  %al
      
      No functional change intended.
      
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Wei Liu <wei.liu@kernel.org>
      Cc: Dexuan Cui <decui@microsoft.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Signed-off-by: default avatarUros Bizjak <ubizjak@gmail.com>
      Reviewed-by: default avatarMichael Kelley <mhklinux@outlook.com>
      Link: https://lore.kernel.org/r/20231114170038.381634-1-ubizjak@gmail.com
      
      
      Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
      Message-ID: <20231114170038.381634-1-ubizjak@gmail.com>
      18286883
    • Hao Ge's avatar
      dpll: Fix potential msg memleak when genlmsg_put_reply failed · b6fe6f03
      Hao Ge authored
      We should clean the skb resource if genlmsg_put_reply failed.
      
      Fixes: 9d71b54b
      
       ("dpll: netlink: Add DPLL framework base functions")
      Signed-off-by: default avatarHao Ge <gehao@kylinos.cn>
      Reviewed-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
      Link: https://lore.kernel.org/r/20231121013709.73323-1-gehao@kylinos.cn
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b6fe6f03
    • Jakub Kicinski's avatar
      Merge tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf · b2d66643
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      pull-request: bpf 2023-11-21
      
      We've added 19 non-merge commits during the last 4 day(s) which contain
      a total of 18 files changed, 1043 insertions(+), 416 deletions(-).
      
      The main changes are:
      
      1) Fix BPF verifier to validate callbacks as if they are called an unknown
         number of times in order to fix not detecting some unsafe programs,
         from Eduard Zingerman.
      
      2) Fix bpf_redirect_peer() handling which missed proper stats accounting
         for veth and netkit and also generally fix missing stats for the latter,
         from Peilin Ye, Daniel Borkmann et al.
      
      * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf:
        selftests/bpf: check if max number of bpf_loop iterations is tracked
        bpf: keep track of max number of bpf_loop callback iterations
        selftests/bpf: test widening for iterating callbacks
        bpf: widening for callback iterators
        selftests/bpf: tests for iterating callbacks
        bpf: verify callbacks as if they are called unknown number of times
        bpf: extract setup_func_entry() utility function
        bpf: extract __check_reg_arg() utility function
        selftests/bpf: fix bpf_loop_bench for new callback verification scheme
        selftests/bpf: track string payload offset as scalar in strobemeta
        selftests/bpf: track tcp payload offset as scalar in xdp_synproxy
        selftests/bpf: Add netkit to tc_redirect selftest
        selftests/bpf: De-veth-ize the tc_redirect test case
        bpf, netkit: Add indirect call wrapper for fetching peer dev
        bpf: Fix dev's rx stats for bpf_redirect_peer traffic
        veth: Use tstats per-CPU traffic counters
        netkit: Add tstats per-CPU traffic counters
        net: Move {l,t,d}stats allocation to core and convert veth & vrf
        net, vrf: Move dstats structure to core
      ====================
      
      Link: https://lore.kernel.org/r/20231121193113.11796-1-daniel@iogearbox.net
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      b2d66643
    • Jakub Kicinski's avatar
      docs: netdev: try to guide people on dealing with silence · 495ec91b
      Jakub Kicinski authored
      There has been more than a few threads which went idle before
      the merge window and now people came back to them and started
      asking about next steps.
      
      We currently tell people to be patient and not to repost too
      often. Our "not too often", however, is still a few orders of
      magnitude faster than other subsystems. Or so I feel after
      hearing people talk about review rates at LPC.
      
      Clarify in the doc that if the discussion went idle for a week
      on netdev, 95% of the time there's no point waiting longer.
      
      Link: https://lore.kernel.org/r/20231120200109.620392-1-kuba@kernel.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      495ec91b
    • Jose Ignacio Tornos Martinez's avatar
      net: usb: ax88179_178a: fix failed operations during ax88179_reset · 0739af07
      Jose Ignacio Tornos Martinez authored
      Using generic ASIX Electronics Corp. AX88179 Gigabit Ethernet device,
      the following test cycle has been implemented:
          - power on
          - check logs
          - shutdown
          - after detecting the system shutdown, disconnect power
          - after approximately 60 seconds of sleep, power is restored
      Running some cycles, sometimes error logs like this appear:
          kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -19
          kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -19
          ...
      These failed operation are happening during ax88179_reset execution, so
      the initialization could not be correct.
      
      In order to avoid this, we need to increase the delay after reset and
      clock initial operations. By using these larger values, many cycles
      have been run and no failed operations appear.
      
      It would be better to check some status register to verify when the
      operation has finished, but I do not have found any available information
      (neither in the public datasheets nor in the manufacturer's driver). The
      only available information for the necessary delays is the maufacturer's
      driver (original values) but the proposed values are not enough for the
      tested devices.
      
      Fixes: e2ca90c2
      
       ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver")
      Reported-by: default avatarHerb Wei <weihao.bj@ieisystem.com>
      Tested-by: default avatarHerb Wei <weihao.bj@ieisystem.com>
      Signed-off-by: default avatarJose Ignacio Tornos Martinez <jtornosm@redhat.com>
      Link: https://lore.kernel.org/r/20231120120642.54334-1-jtornosm@redhat.com
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0739af07
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.7-2' of... · c2d5304e
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform drivers fixes from Ilpo Järvinen:
       "Just a few fixes (one with two non-fix deps) plus tidying up
        MAINTAINERS"
      
      * tag 'platform-drivers-x86-v6.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        platform/x86: intel_telemetry: Fix kernel doc descriptions
        MAINTAINERS: Drop Mark Gross as maintainer for x86 platform drivers
        platform/x86/amd/pmc: adjust getting DRAM size behavior
        platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes()
        platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
        platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
        platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes()
        platform/x86: ideapad-laptop: Set max_brightness before using it
        MAINTAINERS: Remove stale entry for SBL platform driver
      c2d5304e
    • Linus Torvalds's avatar
      Merge tag 'erofs-for-6.7-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs · 6b655223
      Linus Torvalds authored
      Pull erofs fixes from Gao Xiang:
      
       - Tidy up erofs_read_inode() for simplicity
      
       - Fix broken fscache mode due to NULL dereference of dif->bdev_handle
      
       - Add the EROFS webpage to MAINTAINERS, documentation, and Kconfig
      
      * tag 'erofs-for-6.7-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
        MAINTAINERS: erofs: add EROFS webpage
        erofs: fix NULL dereference of dif->bdev_handle in fscache mode
        erofs: simplify erofs_read_inode()
      6b655223
  7. Nov 21, 2023