Skip to content
  1. Feb 10, 2021
    • Stefano Garzarella's avatar
      vsock: fix locking in vsock_shutdown() · 1c5fae9c
      Stefano Garzarella authored
      In vsock_shutdown() we touched some socket fields without holding the
      socket lock, such as 'state' and 'sk_flags'.
      
      Also, after the introduction of multi-transport, we are accessing
      'vsk->transport' in vsock_send_shutdown() without holding the lock
      and this call can be made while the connection is in progress, so
      the transport can change in the meantime.
      
      To avoid issues, we hold the socket lock when we enter in
      vsock_shutdown() and release it when we leave.
      
      Among the transports that implement the 'shutdown' callback, only
      hyperv_transport acquired the lock. Since the caller now holds it,
      we no longer take it.
      
      Fixes: d021c344
      
       ("VSOCK: Introduce VM Sockets")
      Signed-off-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c5fae9c
    • David S. Miller's avatar
      Merge branch 'hns3-fixes' · 49c2547b
      David S. Miller authored
      
      
      Huazhong Tan says:
      
      ====================
      net: hns3: fixes for -net
      
      The parameters sent from vf may be unreliable. If these
      parameters are used directly, memory overwriting may occur.
      
      So this series adds some checks for this case.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49c2547b
    • Yufeng Mo's avatar
      net: hns3: add a check for index in hclge_get_rss_key() · 532cfc0d
      Yufeng Mo authored
      The index is received from vf, if use it directly,
      an out-of-bound issue may be caused, so add a check for
      this index before using it in hclge_get_rss_key().
      
      Fixes: a638b1d8
      
       ("net: hns3: fix get VF RSS issue")
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      532cfc0d
    • Yufeng Mo's avatar
      net: hns3: add a check for tqp_index in hclge_get_ring_chain_from_mbx() · 326334aa
      Yufeng Mo authored
      The tqp_index is received from vf, if use it directly,
      an out-of-bound issue may be caused, so add a check for
      this tqp_index before using it in hclge_get_ring_chain_from_mbx().
      
      Fixes: 84e095d6
      
       ("net: hns3: Change PF to add ring-vect binding & resetQ to mailbox")
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      326334aa
    • Yufeng Mo's avatar
      net: hns3: add a check for queue_id in hclge_reset_vf_queue() · 67a69f84
      Yufeng Mo authored
      The queue_id is received from vf, if use it directly,
      an out-of-bound issue may be caused, so add a check for
      this queue_id before using it in hclge_reset_vf_queue().
      
      Fixes: 1a426f8b
      
       ("net: hns3: fix the VF queue reset flow error")
      Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
      Signed-off-by: default avatarHuazhong Tan <tanhuazhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67a69f84
    • Vladimir Oltean's avatar
      net: dsa: felix: implement port flushing on .phylink_mac_link_down · eb4733d7
      Vladimir Oltean authored
      There are several issues which may be seen when the link goes down while
      forwarding traffic, all of which can be attributed to the fact that the
      port flushing procedure from the reference manual was not closely
      followed.
      
      With flow control enabled on both the ingress port and the egress port,
      it may happen when a link goes down that Ethernet packets are in flight.
      In flow control mode, frames are held back and not dropped. When there
      is enough traffic in flight (example: iperf3 TCP), then the ingress port
      might enter congestion and never exit that state. This is a problem,
      because it is the egress port's link that went down, and that has caused
      the inability of the ingress port to send packets to any other port.
      This is solved by flushing the egress port's queues when it goes down.
      
      There is also a problem when performing stream splitting for
      IEEE 802.1CB traffic (not yet upstream, but a sort of multicast,
      basically). There, if one port from the destination ports mask goes
      down, splitting the stream towards the other destinations will no longer
      be performed. This can be traced down to this line:
      
      	ocelot_port_writel(ocelot_port, 0, DEV_MAC_ENA_CFG);
      
      which should have been instead, as per the reference manual:
      
      	ocelot_port_rmwl(ocelot_port, 0, DEV_MAC_ENA_CFG_RX_ENA,
      			 DEV_MAC_ENA_CFG);
      
      Basically only DEV_MAC_ENA_CFG_RX_ENA should be disabled, but not
      DEV_MAC_ENA_CFG_TX_ENA - I don't have further insight into why that is
      the case, but apparently multicasting to several ports will cause issues
      if at least one of them doesn't have DEV_MAC_ENA_CFG_TX_ENA set.
      
      I am not sure what the state of the Ocelot VSC7514 driver is, but
      probably not as bad as Felix/Seville, since VSC7514 uses phylib and has
      the following in ocelot_adjust_link:
      
      	if (!phydev->link)
      		return;
      
      therefore the port is not really put down when the link is lost, unlike
      the DSA drivers which use .phylink_mac_link_down for that.
      
      Nonetheless, I put ocelot_port_flush() in the common ocelot.c because it
      needs to access some registers from drivers/net/ethernet/mscc/ocelot_rew.h
      which are not exported in include/soc/mscc/ and a bugfix patch should
      probably not move headers around.
      
      Fixes: bdeced75
      
       ("net: dsa: felix: Add PCS operations for PHYLINK")
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eb4733d7
  2. Feb 09, 2021
  3. Feb 07, 2021
  4. Feb 06, 2021
  5. Feb 05, 2021
  6. Feb 04, 2021