1. 28 1月, 2021 6 次提交
  2. 27 1月, 2021 16 次提交
    • D
      can: dev: prevent potential information leak in can_fill_info() · b552766c
      Dan Carpenter 提交于
      The "bec" struct isn't necessarily always initialized. For example, the
      mcp251xfd_get_berr_counter() function doesn't initialize anything if the
      interface is down.
      
      Fixes: 52c793f2 ("can: netlink support for bus-error reporting and counters")
      Link: https://lore.kernel.org/r/YAkaRdRJncsJO8Ve@mwandaSigned-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      b552766c
    • J
      Merge branch 'net-fec-fix-temporary-rmii-clock-reset-on-link-up' · 2bd29748
      Jakub Kicinski 提交于
      Laurent Badel says:
      
      ====================
      net: fec: Fix temporary RMII clock reset on link up
      
      v2: fixed a compilation warning
      
      The FEC drivers performs a "hardware reset" of the MAC module when the
      link is reported to be up. This causes a short glitch in the RMII clock
      due to the hardware reset clearing the receive control register which
      controls the MII mode. It seems that some link partners do not tolerate
      this glitch, and invalidate the link, which leads to a never-ending loop
      of negotiation-link up-link down events.
      
      This was observed with the iMX28 Soc and LAN8720/LAN8742 PHYs, with two
      Intel adapters I218-LM and X722-DA2 as link partners, though a number of
      other link partners do not seem to mind the clock glitch. Changing the
      hardware reset to a software reset (clearing bit 1 of the ECR register)
      cured the issue.
      
      Attempts to optimize fec_restart() in order to minimize the duration of
      the glitch were unsuccessful. Furthermore manually producing the glitch by
      setting MII mode and then back to RMII in two consecutive instructions,
      resulting in a clock glitch <10us in duration, was enough to cause the
      partner to invalidate the link. This strongly suggests that the root cause
      of the link being dropped is indeed the change in clock frequency.
      
      In an effort to minimize changes to driver, the patch proposes to use
      soft reset only for tested SoCs (iMX28) and only if the link is up. This
      preserves hardware reset in other situations, which might be required for
      proper setup of the MAC.
      ====================
      
      Link: https://lore.kernel.org/r/20210125100745.5090-1-laurentbadel@eaton.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      2bd29748
    • L
      net: fec: Fix temporary RMII clock reset on link up · c730ab42
      Laurent Badel 提交于
      fec_restart() does a hard reset of the MAC module when the link status
      changes to up. This temporarily resets the R_CNTRL register which controls
      the MII mode of the ENET_OUT clock. In the case of RMII, the clock
      frequency momentarily drops from 50MHz to 25MHz until the register is
      reconfigured. Some link partners do not tolerate this glitch and
      invalidate the link causing failure to establish a stable link when using
      PHY polling mode. Since as per IEEE802.3 the criteria for link validity
      are PHY-specific, what the partner should tolerate cannot be assumed, so
      avoid resetting the MII clock by using software reset instead of hardware
      reset when the link is up. This is generally relevant only if the SoC
      provides the clock to an external PHY and the PHY is configured for RMII.
      Signed-off-by: NLaurent Badel <laurentbadel@eaton.com>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      c730ab42
    • X
      net: lapb: Add locking to the lapb module · b491e6a7
      Xie He 提交于
      In the lapb module, the timers may run concurrently with other code in
      this module, and there is currently no locking to prevent the code from
      racing on "struct lapb_cb". This patch adds locking to prevent racing.
      
      1. Add "spinlock_t lock" to "struct lapb_cb"; Add "spin_lock_bh" and
      "spin_unlock_bh" to APIs, timer functions and notifier functions.
      
      2. Add "bool t1timer_stop, t2timer_stop" to "struct lapb_cb" to make us
      able to ask running timers to abort; Modify "lapb_stop_t1timer" and
      "lapb_stop_t2timer" to make them able to abort running timers;
      Modify "lapb_t2timer_expiry" and "lapb_t1timer_expiry" to make them
      abort after they are stopped by "lapb_stop_t1timer", "lapb_stop_t2timer",
      and "lapb_start_t1timer", "lapb_start_t2timer".
      
      3. Let lapb_unregister wait for other API functions and running timers
      to stop.
      
      4. The lapb_device_event function calls lapb_disconnect_request. In
      order to avoid trying to hold the lock twice, add a new function named
      "__lapb_disconnect_request" which assumes the lock is held, and make
      it called by lapb_disconnect_request and lapb_device_event.
      
      Fixes: 1da177e4 ("Linux-2.6.12-rc2")
      Cc: Martin Schiller <ms@dev.tdt.de>
      Signed-off-by: NXie He <xie.he.0141@gmail.com>
      Link: https://lore.kernel.org/r/20210126040939.69995-1-xie.he.0141@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      b491e6a7
    • I
      team: protect features update by RCU to avoid deadlock · f0947d0d
      Ivan Vecera 提交于
      Function __team_compute_features() is protected by team->lock
      mutex when it is called from team_compute_features() used when
      features of an underlying device is changed. This causes
      a deadlock when NETDEV_FEAT_CHANGE notifier for underlying device
      is fired due to change propagated from team driver (e.g. MTU
      change). It's because callbacks like team_change_mtu() or
      team_vlan_rx_{add,del}_vid() protect their port list traversal
      by team->lock mutex.
      
      Example (r8169 case where this driver disables TSO for certain MTU
      values):
      ...
      [ 6391.348202]  __mutex_lock.isra.6+0x2d0/0x4a0
      [ 6391.358602]  team_device_event+0x9d/0x160 [team]
      [ 6391.363756]  notifier_call_chain+0x47/0x70
      [ 6391.368329]  netdev_update_features+0x56/0x60
      [ 6391.373207]  rtl8169_change_mtu+0x14/0x50 [r8169]
      [ 6391.378457]  dev_set_mtu_ext+0xe1/0x1d0
      [ 6391.387022]  dev_set_mtu+0x52/0x90
      [ 6391.390820]  team_change_mtu+0x64/0xf0 [team]
      [ 6391.395683]  dev_set_mtu_ext+0xe1/0x1d0
      [ 6391.399963]  do_setlink+0x231/0xf50
      ...
      
      In fact team_compute_features() called from team_device_event()
      does not need to be protected by team->lock mutex and rcu_read_lock()
      is sufficient there for port list traversal.
      
      Fixes: 3d249d4c ("net: introduce ethernet teaming device")
      Cc: Saeed Mahameed <saeed@kernel.org>
      Signed-off-by: NIvan Vecera <ivecera@redhat.com>
      Reviewed-by: NCong Wang <xiyou.wangcong@gmail.com>
      Reviewed-by: NJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20210125074416.4056484-1-ivecera@redhat.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      f0947d0d
    • J
      MAINTAINERS: add David Ahern to IPv4/IPv6 maintainers · 5cfeb562
      Jakub Kicinski 提交于
      David has been the de-facto maintainer for much of the IP code
      for the last couple of years, let's make it official.
      
      Link: https://lore.kernel.org/r/20210122173220.3579491-1-kuba@kernel.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      5cfeb562
    • J
      Merge tag 'mac80211-for-net-2021-01-26' of... · c5e9e8d4
      Jakub Kicinski 提交于
      Merge tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
      
      Johannes Berg says:
      
      ====================
      A couple of fixes:
       * fix 160 MHz channel switch in mac80211
       * fix a staging driver to not deadlock due to some
         recent cfg80211 changes
       * fix NULL-ptr deref if cfg80211 returns -EINPROGRESS
         to wext (syzbot)
       * pause TX in mac80211 in type change to prevent crashes
         (syzbot)
      
      * tag 'mac80211-for-net-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211:
        staging: rtl8723bs: fix wireless regulatory API misuse
        mac80211: pause TX while changing interface type
        wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
        mac80211: 160MHz with extended NSS BW in CSA
      ====================
      
      Link: https://lore.kernel.org/r/20210126130529.75225-1-johannes@sipsolutions.netSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      c5e9e8d4
    • J
      Merge tag 'wireless-drivers-2021-01-26' of... · db22ce68
      Jakub Kicinski 提交于
      Merge tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      wireless-drivers fixes for v5.11
      
      Second set of fixes for v5.11. Like in last time we again have more
      fixes than usual Actually a bit too much for my liking in this state
      of the cycle, but due to unrelated challenges I was only able to
      submit them now.
      
      We have few important crash fixes, iwlwifi modifying read-only data
      being the most reported issue, and also smaller fixes to iwlwifi.
      
      mt76
       * fix a clang warning about enum usage
       * fix rx buffer refcounting crash
      
      mt7601u
       * fix rx buffer refcounting crash
       * fix crash when unbplugging the device
      
      iwlwifi
       * fix a crash where we were modifying read-only firmware data
       * lots of smaller fixes all over the driver
      
      * tag 'wireless-drivers-2021-01-26' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers: (24 commits)
        mt7601u: fix kernel crash unplugging the device
        iwlwifi: queue: bail out on invalid freeing
        iwlwifi: mvm: guard against device removal in reprobe
        iwlwifi: Fix IWL_SUBDEVICE_NO_160 macro to use the correct bit.
        iwlwifi: mvm: clear IN_D3 after wowlan status cmd
        iwlwifi: pcie: add rules to match Qu with Hr2
        iwlwifi: mvm: invalidate IDs of internal stations at mvm start
        iwlwifi: mvm: fix the return type for DSM functions 1 and 2
        iwlwifi: pcie: reschedule in long-running memory reads
        iwlwifi: pcie: use jiffies for memory read spin time limit
        iwlwifi: pcie: fix context info memory leak
        iwlwifi: pcie: add a NULL check in iwl_pcie_txq_unmap
        iwlwifi: pcie: set LTR on more devices
        iwlwifi: queue: don't crash if txq->entries is NULL
        iwlwifi: fix the NMI flow for old devices
        iwlwifi: pnvm: don't try to load after failures
        iwlwifi: pnvm: don't skip everything when not reloading
        iwlwifi: pcie: avoid potential PNVM leaks
        iwlwifi: mvm: take mutex for calling iwl_mvm_get_sync_time()
        iwlwifi: mvm: skip power command when unbinding vif during CSA
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20210126092202.6A367C433CA@smtp.codeaurora.orgSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      db22ce68
    • E
      iwlwifi: provide gso_type to GSO packets · 81a86e1b
      Eric Dumazet 提交于
      net/core/tso.c got recent support for USO, and this broke iwlfifi
      because the driver implemented a limited form of GSO.
      
      Providing ->gso_type allows for skb_is_gso_tcp() to provide
      a correct result.
      
      Fixes: 3d5b459b ("net: tso: add UDP segmentation support")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Reported-by: NBen Greear <greearb@candelatech.com>
      Tested-by: NBen Greear <greearb@candelatech.com>
      Cc: Luca Coelho <luciano.coelho@intel.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=209913
      Link: https://lore.kernel.org/r/20210125150949.619309-1-eric.dumazet@gmail.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
      81a86e1b
    • C
      igc: fix link speed advertising · 329a3678
      Corinna Vinschen 提交于
      Link speed advertising in igc has two problems:
      
      - When setting the advertisement via ethtool, the link speed is converted
        to the legacy 32 bit representation for the intel PHY code.
        This inadvertently drops ETHTOOL_LINK_MODE_2500baseT_Full_BIT (being
        beyond bit 31).  As a result, any call to `ethtool -s ...' drops the
        2500Mbit/s link speed from the PHY settings.  Only reloading the driver
        alleviates that problem.
      
        Fix this by converting the ETHTOOL_LINK_MODE_2500baseT_Full_BIT to the
        Intel PHY ADVERTISE_2500_FULL bit explicitly.
      
      - Rather than checking the actual PHY setting, the .get_link_ksettings
        function always fills link_modes.advertising with all link speeds
        the device is capable of.
      
        Fix this by checking the PHY autoneg_advertised settings and report
        only the actually advertised speeds up to ethtool.
      
      Fixes: 8c5ad0da ("igc: Add ethtool support")
      Signed-off-by: NCorinna Vinschen <vinschen@redhat.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      329a3678
    • S
      i40e: acquire VSI pointer only after VF is initialized · 67a3c6b3
      Stefan Assmann 提交于
      This change simplifies the VF initialization check and also minimizes
      the delay between acquiring the VSI pointer and using it. As known by
      the commit being fixed, there is a risk of the VSI pointer getting
      changed. Therefore minimize the delay between getting and using the
      pointer.
      
      Fixes: 9889707b ("i40e: Fix crash caused by stress setting of VF MAC addresses")
      Signed-off-by: NStefan Assmann <sassmann@kpanic.de>
      Reviewed-by: NJacob Keller <jacob.e.keller@intel.com>
      Tested-by: NKonrad Jankowski <konrad0.jankowski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      67a3c6b3
    • B
      ice: Fix MSI-X vector fallback logic · f3fe97f6
      Brett Creeley 提交于
      The current MSI-X enablement logic tries to enable best-case MSI-X
      vectors and if that fails we only support a bare-minimum set. This
      includes a single MSI-X for 1 Tx and 1 Rx queue and a single MSI-X
      for the OICR interrupt. Unfortunately, the driver fails to load when we
      don't get as many MSI-X as requested for a couple reasons.
      
      First, the code to allocate MSI-X in the driver tries to allocate
      num_online_cpus() MSI-X for LAN traffic without caring about the number
      of MSI-X actually enabled/requested from the kernel for LAN traffic.
      So, when calling ice_get_res() for the PF VSI, it returns failure
      because the number of available vectors is less than requested. Fix
      this by not allowing the PF VSI to allocation  more than
      pf->num_lan_msix MSI-X vectors and pf->num_lan_msix Rx/Tx queues.
      Limiting the number of queues is done because we don't want more than
      1 Tx/Rx queue per interrupt due to performance conerns.
      
      Second, the driver assigns pf->num_lan_msix = 2, to account for LAN
      traffic and the OICR. However, pf->num_lan_msix is only meant for LAN
      MSI-X. This is causing a failure when the PF VSI tries to
      allocate/reserve the minimum pf->num_lan_msix because the OICR MSI-X has
      already been reserved, so there may not be enough MSI-X vectors left.
      Fix this by setting pf->num_lan_msix = 1 for the failure case. Then the
      ICE_MIN_MSIX accounts for the LAN MSI-X and the OICR MSI-X needed for
      the failure case.
      
      Update the related defines used in ice_ena_msix_range() to align with
      the above behavior and remove the unused RDMA defines because RDMA is
      currently not supported. Also, remove the now incorrect comment.
      
      Fixes: 152b978a ("ice: Rework ice_ena_msix_range")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      f3fe97f6
    • B
      ice: Don't allow more channels than LAN MSI-X available · 943b881e
      Brett Creeley 提交于
      Currently users could create more channels than LAN MSI-X available.
      This is happening because there is no check against pf->num_lan_msix
      when checking the max allowed channels and will cause performance issues
      if multiple Tx and Rx queues are tied to a single MSI-X. Fix this by not
      allowing more channels than LAN MSI-X available in pf->num_lan_msix.
      
      Fixes: 87324e74 ("ice: Implement ethtool ops for channels")
      Signed-off-by: NBrett Creeley <brett.creeley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      943b881e
    • N
      ice: update dev_addr in ice_set_mac_address even if HW filter exists · 13ed5e8a
      Nick Nunley 提交于
      Fix the driver to copy the MAC address configured in ndo_set_mac_address
      into dev_addr, even if the MAC filter already exists in HW. In some
      situations (e.g. bonding) the netdev's dev_addr could have been modified
      outside of the driver, with no change to the HW filter, so the driver
      cannot assume that they match.
      
      Fixes: 757976ab ("ice: Fix check for removing/adding mac filters")
      Signed-off-by: NNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      13ed5e8a
    • N
      ice: Implement flow for IPv6 next header (extension header) · 1b0b0b58
      Nick Nunley 提交于
      This patch is based on a similar change to i40e by Slawomir Laba:
      "i40e: Implement flow for IPv6 next header (extension header)".
      
      When a packet contains an IPv6 header with next header which is
      an extension header and not a protocol one, the kernel function
      skb_transport_header called with such sk_buff will return a
      pointer to the extension header and not to the TCP one.
      
      The above explained call caused a problem with packet processing
      for skb with encapsulation for tunnel with ICE_TX_CTX_EIPT_IPV6.
      The extension header was not skipped at all.
      
      The ipv6_skip_exthdr function does check if next header of the IPV6
      header is an extension header and doesn't modify the l4_proto pointer
      if it points to a protocol header value so its safe to omit the
      comparison of exthdr and l4.hdr pointers. The ipv6_skip_exthdr can
      return value -1. This means that the skipping process failed
      and there is something wrong with the packet so it will be dropped.
      
      Fixes: a4e82a81 ("ice: Add support for tunnel offloads")
      Signed-off-by: NNick Nunley <nicholas.d.nunley@intel.com>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      1b0b0b58
    • H
      ice: fix FDir IPv6 flexbyte · 29e2d9eb
      Henry Tieman 提交于
      The packet classifier would occasionally misrecognize an IPv6 training
      packet when the next protocol field was 0. The correct value for
      unspecified protocol is IPPROTO_NONE.
      
      Fixes: 165d80d6 ("ice: Support IPv6 Flow Director filters")
      Signed-off-by: NHenry Tieman <henry.w.tieman@intel.com>
      Reviewed-by: NPaul Menzel <pmenzel@molgen.mpg.de>
      Tested-by: NTony Brelinski <tonyx.brelinski@intel.com>
      Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
      29e2d9eb
  3. 26 1月, 2021 4 次提交
  4. 25 1月, 2021 14 次提交