1. 27 12月, 2019 1 次提交
    • P
      vxlan: Fix error path in __vxlan_dev_create() · e44201e4
      Petr Machata 提交于
      mainline inclusion
      from mainline-4.20
      commit 6db92468
      category: bugfix
      bugzilla: 6186
      CVE: NA
      
      -------------------------------------------------
      
      When a failure occurs in rtnl_configure_link(), the current code
      calls unregister_netdevice() to roll back the earlier call to
      register_netdevice(), and jumps to errout, which calls
      vxlan_fdb_destroy().
      
      However unregister_netdevice() calls transitively ndo_uninit, which is
      vxlan_uninit(), and that already takes care of deleting the default FDB
      entry by calling vxlan_fdb_delete_default(). Since the entry added
      earlier in __vxlan_dev_create() is exactly the default entry, the
      cleanup code in the errout block always leads to double free and thus a
      panic.
      
      Besides, since vxlan_fdb_delete_default() always destroys the FDB entry
      with notification enabled, the deletion of the default entry is notified
      even before the addition was notified.
      
      Instead, move the unregister_netdevice() call after the manual destroy,
      which solves both problems.
      
      Fixes: 0241b836 ("vxlan: fix default fdb entry netlink notify ordering during netdev create")
      Signed-off-by: NPetr Machata <petrm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NMao Wenan <maowenan@huawei.com>
      Reviewed-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      e44201e4
  2. 18 10月, 2018 2 次提交
  3. 27 9月, 2018 1 次提交
  4. 23 7月, 2018 3 次提交
  5. 07 7月, 2018 3 次提交
  6. 02 7月, 2018 1 次提交
    • S
      net: fix use-after-free in GRO with ESP · 603d4cf8
      Sabrina Dubroca 提交于
      Since the addition of GRO for ESP, gro_receive can consume the skb and
      return -EINPROGRESS. In that case, the lower layer GRO handler cannot
      touch the skb anymore.
      
      Commit 5f114163 ("net: Add a skb_gro_flush_final helper.") converted
      some of the gro_receive handlers that can lead to ESP's gro_receive so
      that they wouldn't access the skb when -EINPROGRESS is returned, but
      missed other spots, mainly in tunneling protocols.
      
      This patch finishes the conversion to using skb_gro_flush_final(), and
      adds a new helper, skb_gro_flush_final_remcsum(), used in VXLAN and
      GUE.
      
      Fixes: 5f114163 ("net: Add a skb_gro_flush_final helper.")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Reviewed-by: NStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      603d4cf8
  7. 29 6月, 2018 1 次提交
  8. 26 6月, 2018 1 次提交
    • D
      net: Convert GRO SKB handling to list_head. · d4546c25
      David Miller 提交于
      Manage pending per-NAPI GRO packets via list_head.
      
      Return an SKB pointer from the GRO receive handlers.  When GRO receive
      handlers return non-NULL, it means that this SKB needs to be completed
      at this time and removed from the NAPI queue.
      
      Several operations are greatly simplified by this transformation,
      especially timing out the oldest SKB in the list when gro_count
      exceeds MAX_GRO_SKBS, and napi_gro_flush() which walks the queue
      in reverse order.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4546c25
  9. 18 4月, 2018 1 次提交
  10. 28 3月, 2018 1 次提交
  11. 28 2月, 2018 1 次提交
  12. 26 1月, 2018 1 次提交
  13. 20 12月, 2017 1 次提交
    • X
      vxlan: update skb dst pmtu on tx path · a93bf0ff
      Xin Long 提交于
      Unlike ip tunnels, now vxlan doesn't do any pmtu update for
      upper dst pmtu, even if it doesn't match the lower dst pmtu
      any more.
      
      The problem can be reproduced when reducing the vxlan lower
      dev's pmtu when running netperf. In jianlin's testing, the
      performance went to 1/7 of the previous.
      
      This patch is to update the upper dst pmtu to match the lower
      dst pmtu on tx path so that packets can be sent out even when
      lower dev's pmtu has been changed.
      
      It also works for metadata dst.
      
      Note that this patch doesn't process any pmtu icmp packet.
      But even in the future, the support for pmtu icmp packets
      process of udp tunnels will also needs this.
      
      The same thing will be done for geneve in another patch.
      Signed-off-by: NXin Long <lucien.xin@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a93bf0ff
  14. 19 12月, 2017 1 次提交
  15. 17 12月, 2017 1 次提交
    • A
      vxlan: restore dev->mtu setting based on lower device · f870c1ff
      Alexey Kodanev 提交于
      Stefano Brivio says:
          Commit a985343b ("vxlan: refactor verification and
          application of configuration") introduced a change in the
          behaviour of initial MTU setting: earlier, the MTU for a link
          created on top of a given lower device, without an initial MTU
          specification, was set to the MTU of the lower device minus
          headroom as a result of this path in vxlan_dev_configure():
      
      	if (!conf->mtu)
      		dev->mtu = lowerdev->mtu -
      			   (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
      
          which is now gone. Now, the initial MTU, in absence of a
          configured value, is simply set by ether_setup() to ETH_DATA_LEN
          (1500 bytes).
      
          This breaks userspace expectations in case the MTU of
          the lower device is higher than 1500 bytes minus headroom.
      
      This patch restores the previous behaviour on newlink operation. Since
      max_mtu can be negative and we update dev->mtu directly, also check it
      for valid minimum.
      Reported-by: NJunhan Yan <juyan@redhat.com>
      Fixes: a985343b ("vxlan: refactor verification and application of configuration")
      Signed-off-by: NAlexey Kodanev <alexey.kodanev@oracle.com>
      Acked-by: NStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: NStefano Brivio <sbrivio@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f870c1ff
  16. 29 11月, 2017 1 次提交
  17. 14 11月, 2017 2 次提交
  18. 05 10月, 2017 1 次提交
    • K
      timer: Remove init_timer_deferrable() in favor of timer_setup() · df7e828c
      Kees Cook 提交于
      This refactors the only users of init_timer_deferrable() to use
      the new timer_setup() and from_timer(). Removes definition of
      init_timer_deferrable().
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: David S. Miller <davem@davemloft.net> # for networking parts
      Acked-by: Sebastian Reichel <sre@kernel.org> # for drivers/hsi parts
      Cc: linux-mips@linux-mips.org
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Lai Jiangshan <jiangshanlai@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Kalle Valo <kvalo@qca.qualcomm.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: linux1394-devel@lists.sourceforge.net
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: linux-s390@vger.kernel.org
      Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Ursula Braun <ubraun@linux.vnet.ibm.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Harish Patil <harish.patil@cavium.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Manish Chopra <manish.chopra@cavium.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: linux-pm@vger.kernel.org
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Julian Wiedmann <jwi@linux.vnet.ibm.com>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Mark Gross <mark.gross@intel.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: linux-watchdog@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: linux-wireless@vger.kernel.org
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
      Cc: Michael Reed <mdr@sgi.com>
      Cc: netdev@vger.kernel.org
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
      Link: https://lkml.kernel.org/r/1507159627-127660-6-git-send-email-keescook@chromium.org
      df7e828c
  19. 30 8月, 2017 1 次提交
    • J
      vxlan: factor out VXLAN-GPE next protocol · fa20e0e3
      Jiri Benc 提交于
      The values are shared between VXLAN-GPE and NSH. Originally probably by
      coincidence but I notified both working groups about this last year and they
      seem to keep the values in sync since then.
      
      Hopefully they'll get a single IANA registry for the values, too. (I asked
      them for that.)
      
      Factor out the code to be shared by the NSH implementation.
      
      NSH and MPLS values are added in this patch, too. For MPLS, the drafts
      incorrectly assign only a single value, while we have two MPLS ethertypes.
      I raised the problem with both groups. For now, I assume the value is for
      unicast.
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa20e0e3
  20. 14 8月, 2017 1 次提交
  21. 02 8月, 2017 1 次提交
    • K
      vxlan: fix remcsum when GRO on and CHECKSUM_PARTIAL boundary is outer UDP · be73b304
      K. Den 提交于
      In the case that GRO is turned on and the original received packet is
      CHECKSUM_PARTIAL, if the outer UDP header is exactly at the last
      csum-unnecessary point, which for instance could occur if the packet
      comes from another Linux guest on the same Linux host, we have to do
      either remcsum_adjust or set up CHECKSUM_PARTIAL again with its
      csum_start properly reset considering RCO.
      
      However, since b7fe10e5("gro: Fix remcsum offload to deal with frags
      in GRO") that barrier in such case could be skipped if GRO turned on,
      hence we pass over it and the inner L4 validation mistakenly reckons
      it as a bad csum.
      
      This patch makes remcsum_offload being reset at the same time of GRO
      remcsum cleanup, so as to make it work in such case as before.
      
      Fixes: b7fe10e5 ("gro: Fix remcsum offload to deal with frags in GRO")
      Signed-off-by: NKoichiro Den <den@klaipeden.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be73b304
  22. 25 7月, 2017 2 次提交
  23. 05 7月, 2017 1 次提交
  24. 03 7月, 2017 2 次提交
  25. 28 6月, 2017 1 次提交
  26. 27 6月, 2017 3 次提交
  27. 21 6月, 2017 4 次提交