Skip to content
Snippets Groups Projects
  1. May 16, 2020
  2. May 15, 2020
  3. May 14, 2020
  4. May 13, 2020
    • Paolo Abeni's avatar
      netlabel: cope with NULL catmap · eead1c2e
      Paolo Abeni authored
      
      The cipso and calipso code can set the MLS_CAT attribute on
      successful parsing, even if the corresponding catmap has
      not been allocated, as per current configuration and external
      input.
      
      Later, selinux code tries to access the catmap if the MLS_CAT flag
      is present via netlbl_catmap_getlong(). That may cause null ptr
      dereference while processing incoming network traffic.
      
      Address the issue setting the MLS_CAT flag only if the catmap is
      really allocated. Additionally let netlbl_catmap_getlong() cope
      with NULL catmap.
      
      Reported-by: default avatarMatthew Sheets <matthew.sheets@gd-ms.com>
      Fixes: 4b8feff2 ("netlabel: fix the horribly broken catmap functions")
      Fixes: ceba1832 ("calipso: Set the calipso socket label to match the secattr.")
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      Acked-by: default avatarPaul Moore <paul@paul-moore.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      eead1c2e
    • Eric Dumazet's avatar
      tcp: fix SO_RCVLOWAT hangs with fat skbs · 24adbc16
      Eric Dumazet authored
      
      We autotune rcvbuf whenever SO_RCVLOWAT is set to account for 100%
      overhead in tcp_set_rcvlowat()
      
      This works well when skb->len/skb->truesize ratio is bigger than 0.5
      
      But if we receive packets with small MSS, we can end up in a situation
      where not enough bytes are available in the receive queue to satisfy
      RCVLOWAT setting.
      As our sk_rcvbuf limit is hit, we send zero windows in ACK packets,
      preventing remote peer from sending more data.
      
      Even autotuning does not help, because it only triggers at the time
      user process drains the queue. If no EPOLLIN is generated, this
      can not happen.
      
      Note poll() has a similar issue, after commit
      c7004482 ("tcp: Respect SO_RCVLOWAT in tcp_poll().")
      
      Fixes: 03f45c88 ("tcp: avoid extra wakeups for SO_RCVLOWAT users")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Acked-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      24adbc16
    • Clay McClure's avatar
      net: ethernet: ti: Remove TI_CPTS_MOD workaround · 92db978f
      Clay McClure authored
      
      My recent commit b6d49cab ("net: Make PTP-specific drivers depend on
      PTP_1588_CLOCK") exposes a missing dependency in defconfigs that select
      TI_CPTS without selecting PTP_1588_CLOCK, leading to linker errors of the
      form:
      
      drivers/net/ethernet/ti/cpsw.o: in function `cpsw_ndo_stop':
      cpsw.c:(.text+0x680): undefined reference to `cpts_unregister'
       ...
      
      That's because TI_CPTS_MOD (which is the symbol gating the _compilation_ of
      cpts.c) now depends on PTP_1588_CLOCK, and so is not enabled in these
      configurations, but TI_CPTS (which is the symbol gating _calls_ to the cpts
      functions) _is_ enabled. So we end up compiling calls to functions that
      don't exist, resulting in the linker errors.
      
      This patch fixes build errors and restores previous behavior by:
       - ensure PTP_1588_CLOCK=y in TI specific configs and CPTS will be built
       - remove TI_CPTS_MOD and, instead, add dependencies from CPTS in
         TI_CPSW/TI_KEYSTONE_NETCP/TI_CPSW_SWITCHDEV as below:
      
         config TI_CPSW_SWITCHDEV
         ...
          depends on TI_CPTS || !TI_CPTS
      
         which will ensure proper dependencies PTP_1588_CLOCK -> TI_CPTS ->
      TI_CPSW/TI_KEYSTONE_NETCP/TI_CPSW_SWITCHDEV and build type selection.
      
      Note. For NFS boot + CPTS all of above configs have to be built-in.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dan Murphy <dmurphy@ti.com>
      Cc: Tony Lindgren <tony@atomide.com>
      Fixes: b6d49cab ("net: Make PTP-specific drivers depend on PTP_1588_CLOCK")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarClay McClure <clay@daemons.net>
      [grygorii.strashko@ti.com: rewording, add deps cpsw/netcp from cpts, drop IS_REACHABLE]
      Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Tested-by: default avatarTony Lindgren <tony@atomide.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      92db978f
    • David S. Miller's avatar
      Merge branch 'ionic-fixes' · d6718ccb
      David S. Miller authored
      
      Shannon Nelson says:
      
      ====================
      ionic fixes
      
      These are a couple more fixes after more fw-upgrade testing.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d6718ccb
    • Shannon Nelson's avatar
      ionic: call ionic_port_init after fw-upgrade · ddc5911b
      Shannon Nelson authored
      
      Since the fw has been re-inited, we need to refresh the port
      information dma address so we can see fresh port information.
      Let's call ionic_port_init again, and tweak it to allow for
      a call to simply refresh the existing dma address.
      
      Fixes: c672412f ("ionic: remove lifs on fw reset")
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ddc5911b
    • Shannon Nelson's avatar
      ionic: leave netdev mac alone after fw-upgrade · f20a4d40
      Shannon Nelson authored
      
      When running in a bond setup, or some other potential
      configurations, the netdev mac may have been changed from
      the default device mac.  Since the userland doesn't know
      about the changes going on under the covers in a fw-upgrade
      it doesn't know the re-push the mac filter.  The driver
      needs to leave the netdev mac filter alone when rebuilding
      after the fw-upgrade.
      
      Fixes: c672412f ("ionic: remove lifs on fw reset")
      Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f20a4d40