1. 26 6月, 2020 3 次提交
    • T
      net: bridge: enfore alignment for ethernet address · 206e7323
      Thomas Martitz 提交于
      The eth_addr member is passed to ether_addr functions that require
      2-byte alignment, therefore the member must be properly aligned
      to avoid unaligned accesses.
      
      The problem is in place since the initial merge of multicast to unicast:
      commit 6db6f0ea bridge: multicast to unicast
      
      Fixes: 6db6f0ea ("bridge: multicast to unicast")
      Cc: Roopa Prabhu <roopa@cumulusnetworks.com>
      Cc: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: Felix Fietkau <nbd@nbd.name>
      Signed-off-by: NThomas Martitz <t.martitz@avm.de>
      Acked-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      206e7323
    • D
      tcp: don't ignore ECN CWR on pure ACK · 25702840
      Denis Kirjanov 提交于
      there is a problem with the CWR flag set in an incoming ACK segment
      and it leads to the situation when the ECE flag is latched forever
      
      the following packetdrill script shows what happens:
      
      // Stack receives incoming segments with CE set
      +0.1 <[ect0]  . 11001:12001(1000) ack 1001 win 65535
      +0.0 <[ce]    . 12001:13001(1000) ack 1001 win 65535
      +0.0 <[ect0] P. 13001:14001(1000) ack 1001 win 65535
      
      // Stack repsonds with ECN ECHO
      +0.0 >[noecn]  . 1001:1001(0) ack 12001
      +0.0 >[noecn] E. 1001:1001(0) ack 13001
      +0.0 >[noecn] E. 1001:1001(0) ack 14001
      
      // Write a packet
      +0.1 write(3, ..., 1000) = 1000
      +0.0 >[ect0] PE. 1001:2001(1000) ack 14001
      
      // Pure ACK received
      +0.01 <[noecn] W. 14001:14001(0) ack 2001 win 65535
      
      // Since CWR was sent, this packet should NOT have ECE set
      
      +0.1 write(3, ..., 1000) = 1000
      +0.0 >[ect0]  P. 2001:3001(1000) ack 14001
      // but Linux will still keep ECE latched here, with packetdrill
      // flagging a missing ECE flag, expecting
      // >[ect0] PE. 2001:3001(1000) ack 14001
      // in the script
      
      In the situation above we will continue to send ECN ECHO packets
      and trigger the peer to reduce the congestion window. To avoid that
      we can check CWR on pure ACKs received.
      
      v3:
      - Add a sequence check to avoid sending an ACK to an ACK
      
      v2:
      - Adjusted the comment
      - move CWR check before checking for unacknowledged packets
      Signed-off-by: NDenis Kirjanov <denis.kirjanov@suse.com>
      Acked-by: NNeal Cardwell <ncardwell@google.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25702840
    • A
      net: phy: mscc: avoid skcipher API for single block AES encryption · 5a3235e5
      Ard Biesheuvel 提交于
      The skcipher API dynamically instantiates the transformation object
      on request that implements the requested algorithm optimally on the
      given platform. This notion of optimality only matters for cases like
      bulk network or disk encryption, where performance can be a bottleneck,
      or in cases where the algorithm itself is not known at compile time.
      
      In the mscc case, we are dealing with AES encryption of a single
      block, and so neither concern applies, and we are better off using
      the AES library interface, which is lightweight and safe for this
      kind of use.
      
      Note that the scatterlist API does not permit references to buffers
      that are located on the stack, so the existing code is incorrect in
      any case, but avoiding the skcipher and scatterlist APIs entirely is
      the most straight-forward approach to fixing this.
      
      Cc: Antoine Tenart <antoine.tenart@bootlin.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Fixes: 28c5107a ("net: phy: mscc: macsec support")
      Reviewed-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NArd Biesheuvel <ardb@kernel.org>
      Tested-by: NAntoine Tenart <antoine.tenart@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a3235e5
  2. 25 6月, 2020 12 次提交
    • D
      Merge branch 'net-bcmgenet-use-hardware-padding-of-runt-frames' · eb2932b0
      David S. Miller 提交于
      Doug Berger says:
      
      ====================
      net: bcmgenet: use hardware padding of runt frames
      
      Now that scatter-gather and tx-checksumming are enabled by default
      it revealed a packet corruption issue that can occur for very short
      fragmented packets.
      
      When padding these frames to the minimum length it is possible for
      the non-linear (fragment) data to be added to the end of the linear
      header in an SKB. Since the number of fragments is read before the
      padding and used afterward without reloading, the fragment that
      should have been consumed can be tacked on in place of part of the
      padding.
      
      The third commit in this set corrects this by removing the software
      padding and allowing the hardware to add the pad bytes if necessary.
      
      The first two commits resolve warnings observed by the kbuild test
      robot and are included here for simplicity of application.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb2932b0
    • D
      net: bcmgenet: use hardware padding of runt frames · 20d1f2d1
      Doug Berger 提交于
      When commit 474ea9ca ("net: bcmgenet: correctly pad short
      packets") added the call to skb_padto() it should have been
      located before the nr_frags parameter was read since that value
      could be changed when padding packets with lengths between 55
      and 59 bytes (inclusive).
      
      The use of a stale nr_frags value can cause corruption of the
      pad data when tx-scatter-gather is enabled. This corruption of
      the pad can cause invalid checksum computation when hardware
      offload of tx-checksum is also enabled.
      
      Since the original reason for the padding was corrected by
      commit 7dd39913 ("net: bcmgenet: fix skb_len in
      bcmgenet_xmit_single()") we can remove the software padding all
      together and make use of hardware padding of short frames as
      long as the hardware also always appends the FCS value to the
      frame.
      
      Fixes: 474ea9ca ("net: bcmgenet: correctly pad short packets")
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20d1f2d1
    • D
      net: bcmgenet: use __be16 for htons(ETH_P_IP) · d966d2ef
      Doug Berger 提交于
      The 16-bit value that holds a short in network byte order should
      be declared as a restricted big endian type to allow type checks
      to succeed during assignment.
      
      Fixes: 3e370952 ("net: bcmgenet: add support for ethtool rxnfc flows")
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d966d2ef
    • D
      net: bcmgenet: re-remove bcmgenet_hfb_add_filter · 673bafd5
      Doug Berger 提交于
      This function was originally removed by Baoyou Xie in
      commit e2072600 ("net: bcmgenet: remove unused function in
      bcmgenet.c") to prevent a build warning.
      
      Some of the functions removed by Baoyou Xie are now used for
      WAKE_FILTER support so his commit was reverted, but this function
      is still unused and the kbuild test robot dutifully reported the
      warning.
      
      This commit once again removes the remaining unused hfb functions.
      
      Fixes: 14da1510 ("Revert "net: bcmgenet: remove unused function in bcmgenet.c"")
      Reported-by: Nkbuild test robot <lkp@intel.com>
      Signed-off-by: NDoug Berger <opendmb@gmail.com>
      Acked-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      673bafd5
    • C
      qed: add missing error test for DBG_STATUS_NO_MATCHING_FRAMING_MODE · a5124386
      Colin Ian King 提交于
      The error DBG_STATUS_NO_MATCHING_FRAMING_MODE was added to the enum
      enum dbg_status however there is a missing corresponding entry for
      this in the array s_status_str. This causes an out-of-bounds read when
      indexing into the last entry of s_status_str.  Fix this by adding in
      the missing entry.
      
      Addresses-Coverity: ("Out-of-bounds read").
      Fixes: 2d22bc83 ("qed: FW 8.42.2.0 debug features")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5124386
    • D
      Merge branch 'net-phy-call-phy_disable_interrupts-in-phy_init_hw' · 482f3bae
      David S. Miller 提交于
      Jisheng Zhang says:
      
      ====================
      net: phy: call phy_disable_interrupts() in phy_init_hw()
      
      We face an issue with rtl8211f, a pin is shared between INTB and PMEB,
      and the PHY Register Accessible Interrupt is enabled by default, so
      the INTB/PMEB pin is always active in polling mode case.
      
      As Heiner pointed out "I was thinking about calling
      phy_disable_interrupts() in phy_init_hw(), to have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state."
      
      patch1 makes phy_disable_interrupts() non-static so that it could be used
      in phy_init_hw() to have a defined init state.
      
      patch2 calls phy_disable_interrupts() in phy_init_hw() to have a
      defined init state.
      
      Since v3:
        - call phy_disable_interrupts() have interrupts disabled first then
          config_init, thank Florian
      
      Since v2:
        - Don't export phy_disable_interrupts() but just make it non-static
      
      Since v1:
        - EXPORT the correct symbol
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      482f3bae
    • J
      net: phy: call phy_disable_interrupts() in phy_init_hw() · 9886a4db
      Jisheng Zhang 提交于
      Call phy_disable_interrupts() in phy_init_hw() to "have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state." as pointed
      out by Heiner.
      Suggested-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9886a4db
    • J
      net: phy: make phy_disable_interrupts() non-static · 3dd4ef1b
      Jisheng Zhang 提交于
      We face an issue with rtl8211f, a pin is shared between INTB and PMEB,
      and the PHY Register Accessible Interrupt is enabled by default, so
      the INTB/PMEB pin is always active in polling mode case.
      
      As Heiner pointed out "I was thinking about calling
      phy_disable_interrupts() in phy_init_hw(), to have a defined init
      state as we don't know in which state the PHY is if the PHY driver is
      loaded. We shouldn't assume that it's the chip power-on defaults, BIOS
      or boot loader could have changed this. Or in case of dual-boot
      systems the other OS could leave the PHY in whatever state."
      
      Make phy_disable_interrupts() non-static so that it could be used in
      phy_init_hw() to have a defined init state.
      Suggested-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3dd4ef1b
    • S
      net: ethernet: mvneta: Add back interface mode validation · 41c2b6b4
      Sascha Hauer 提交于
      When writing the serdes configuration register was moved to
      mvneta_config_interface() the whole code block was removed from
      mvneta_port_power_up() in the assumption that its only purpose was to
      write the serdes configuration register. As mentioned by Russell King
      its purpose was also to check for valid interface modes early so that
      later in the driver we do not have to care for unexpected interface
      modes.
      Add back the test to let the driver bail out early on unhandled
      interface modes.
      
      Fixes: b4748553 ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy")
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Reviewed-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41c2b6b4
    • S
      net: ethernet: mvneta: Do not error out in non serdes modes · d3d239dc
      Sascha Hauer 提交于
      In mvneta_config_interface() the RGMII modes are catched by the default
      case which is an error return. The RGMII modes are valid modes for the
      driver, so instead of returning an error add a break statement to return
      successfully.
      
      This avoids this warning for non comphy SoCs which use RGMII, like
      SolidRun Clearfog:
      
      WARNING: CPU: 0 PID: 268 at drivers/net/ethernet/marvell/mvneta.c:3512 mvneta_start_dev+0x220/0x23c
      
      Fixes: b4748553 ("net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy")
      Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
      Reviewed-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3d239dc
    • D
      dsa: Allow forwarding of redirected IGMP traffic · 1ed9ec9b
      Daniel Mack 提交于
      The driver for Marvell switches puts all ports in IGMP snooping mode
      which results in all IGMP/MLD frames that ingress on the ports to be
      forwarded to the CPU only.
      
      The bridge code in the kernel can then interpret these frames and act
      upon them, for instance by updating the mdb in the switch to reflect
      multicast memberships of stations connected to the ports. However,
      the IGMP/MLD frames must then also be forwarded to other ports of the
      bridge so external IGMP queriers can track membership reports, and
      external multicast clients can receive query reports from foreign IGMP
      queriers.
      
      Currently, this is impossible as the EDSA tagger sets offload_fwd_mark
      on the skb when it unwraps the tagged frames, and that will make the
      switchdev layer prevent the skb from egressing on any other port of
      the same switch.
      
      To fix that, look at the To_CPU code in the DSA header and make
      forwarding of the frame possible for trapped IGMP packets.
      
      Introduce some #defines for the frame types to make the code a bit more
      comprehensive.
      
      This was tested on a Marvell 88E6352 variant.
      Signed-off-by: NDaniel Mack <daniel@zonque.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ed9ec9b
    • L
      openvswitch: take into account de-fragmentation/gso_size in execute_check_pkt_len · 17843655
      Lorenzo Bianconi 提交于
      ovs connection tracking module performs de-fragmentation on incoming
      fragmented traffic. Take info account if traffic has been de-fragmented
      in execute_check_pkt_len action otherwise we will perform the wrong
      nested action considering the original packet size. This issue typically
      occurs if ovs-vswitchd adds a rule in the pipeline that requires connection
      tracking (e.g. OVN stateful ACLs) before execute_check_pkt_len action.
      Moreover take into account GSO fragment size for GSO packet in
      execute_check_pkt_len routine
      
      Fixes: 4d5ec89f ("net: openvswitch: Add a new action check_pkt_len")
      Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17843655
  3. 24 6月, 2020 25 次提交