10 Dec, 2019

1 commit

  • Replace all the occurrences of FIELD_SIZEOF() with sizeof_field() except
    at places where these are defined. Later patches will remove the unused
    definition of FIELD_SIZEOF().

    This patch is generated using following script:

    EXCLUDE_FILES="include/linux/stddef.h|include/linux/kernel.h"

    git grep -l -e "\bFIELD_SIZEOF\b" | while read file;
    do

    if [[ "$file" =~ $EXCLUDE_FILES ]]; then
    continue
    fi
    sed -i -e 's/\bFIELD_SIZEOF\b/sizeof_field/g' $file;
    done

    Signed-off-by: Pankaj Bharadiya
    Link: https://lore.kernel.org/r/20190924105839.110713-3-pankaj.laxminarayan.bharadiya@intel.com
    Co-developed-by: Kees Cook
    Signed-off-by: Kees Cook
    Acked-by: David Miller # for net

    Pankaj Bharadiya
     

05 Dec, 2019

1 commit

  • ipv6_stub uses the ip6_dst_lookup function to allow other modules to
    perform IPv6 lookups. However, this function skips the XFRM layer
    entirely.

    All users of ipv6_stub->ip6_dst_lookup use ip_route_output_flow (via the
    ip_route_output_key and ip_route_output helpers) for their IPv4 lookups,
    which calls xfrm_lookup_route(). This patch fixes this inconsistent
    behavior by switching the stub to ip6_dst_lookup_flow, which also calls
    xfrm_lookup_route().

    This requires some changes in all the callers, as these two functions
    take different arguments and have different return types.

    Fixes: 5f81bd2e5d80 ("ipv6: export a stub for IPv6 symbols used by vxlan")
    Reported-by: Xiumei Mu
    Signed-off-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Sabrina Dubroca
     

05 Sep, 2019

1 commit

  • IN_MULTICAST's primary intent is as a uapi macro.

    Elsewhere in the kernel we use ipv4_is_multicast consistently.

    This patch unifies linux's multicast checks to use that function
    rather than this macro.

    Signed-off-by: Dave Taht
    Reviewed-by: Toke Høiland-Jørgensen
    Signed-off-by: David S. Miller

    Dave Taht
     

22 Jun, 2019

1 commit

  • Pull still more SPDX updates from Greg KH:
    "Another round of SPDX updates for 5.2-rc6

    Here is what I am guessing is going to be the last "big" SPDX update
    for 5.2. It contains all of the remaining GPLv2 and GPLv2+ updates
    that were "easy" to determine by pattern matching. The ones after this
    are going to be a bit more difficult and the people on the spdx list
    will be discussing them on a case-by-case basis now.

    Another 5000+ files are fixed up, so our overall totals are:
    Files checked: 64545
    Files with SPDX: 45529

    Compared to the 5.1 kernel which was:
    Files checked: 63848
    Files with SPDX: 22576

    This is a huge improvement.

    Also, we deleted another 20000 lines of boilerplate license crud,
    always nice to see in a diffstat"

    * tag 'spdx-5.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: (65 commits)
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 507
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 506
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 505
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 504
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 503
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 502
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 501
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 499
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 498
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 496
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 495
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 491
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 490
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 489
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 488
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 487
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 486
    treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 485
    ...

    Linus Torvalds
     

19 Jun, 2019

1 commit

  • Based on 2 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation #

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 4122 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Enrico Weigelt
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

12 Jun, 2019

1 commit

  • In commit a07966447f39 ("geneve: ICMP error lookup handler") I wrongly
    assumed buffers from icmp_socket_deliver() would be linear. This is not
    the case: icmp_socket_deliver() only guarantees we have 8 bytes of linear
    data.

    Eric fixed this same issue for fou and fou6 in commits 26fc181e6cac
    ("fou, fou6: do not assume linear skbs") and 5355ed6388e2 ("fou, fou6:
    avoid uninit-value in gue_err() and gue6_err()").

    Use pskb_may_pull() instead of checking skb->len, and take into account
    the fact we later access the GENEVE header with udp_hdr(), so we also
    need to sum skb_transport_header() here.

    Reported-by: Guillaume Nault
    Fixes: a07966447f39 ("geneve: ICMP error lookup handler")
    Signed-off-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Stefano Brivio
     

30 Mar, 2019

1 commit

  • The number of stubs is growing and has nothing to do with addrconf.
    Move the definition of the stubs to a separate header file and update
    users. In the move, drop the vxlan specific comment before ipv6_stub.

    Code move only; no functional change intended.

    Signed-off-by: David Ahern
    Signed-off-by: David S. Miller

    David Ahern
     

23 Mar, 2019

1 commit


02 Mar, 2019

1 commit

  • When IPv6 is compiled but disabled at runtime, geneve_sock_add returns
    -EAFNOSUPPORT. For metadata based tunnels, this causes failure of the whole
    operation of bringing up the tunnel.

    Ignore failure of IPv6 socket creation for metadata based tunnels caused by
    IPv6 not being available.

    This is the same fix as what commit d074bf960044 ("vxlan: correctly handle
    ipv6.disable module parameter") is doing for vxlan.

    Note there's also commit c0a47e44c098 ("geneve: should not call rt6_lookup()
    when ipv6 was disabled") which fixes a similar issue but for regular
    tunnels, while this patch is needed for metadata based tunnels.

    Signed-off-by: Jiri Benc
    Signed-off-by: David S. Miller

    Jiri Benc
     

08 Feb, 2019

1 commit

  • When we add a new GENEVE device with IPv6 remote, checking only for
    IS_ENABLED(CONFIG_IPV6) is not enough as we may disable IPv6 in the
    kernel command line (ipv6.disable=1), and calling rt6_lookup() would
    cause a NULL pointer dereference.

    v2:
    - don't mix declarations and code (reported by Stefano Brivio, Eric Dumazet)
    - there's no need to use in6_dev_get() as we only need to check that
    idev exists (reported by David Ahern). This is under RTNL, so we can
    simply use __in6_dev_get() instead (Stefano, Eric).

    Reported-by: Jianlin Shi
    Fixes: c40e89fd358e9 ("geneve: configure MTU based on a lower device")
    Cc: Alexey Kodanev
    Signed-off-by: Hangbin Liu
    Reviewed-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Hangbin Liu
     

18 Nov, 2018

1 commit

  • Clang warns:

    drivers/net/geneve.c:428:29: error: suggest braces around initialization
    of subobject [-Werror,-Wmissing-braces]
    struct in6_addr addr6 = { 0 };
    ^
    {}

    Rather than trying to appease the various compilers that support the
    kernel, use memset, which is unambiguous.

    Fixes: a07966447f39 ("geneve: ICMP error lookup handler")
    Suggested-by: David S. Miller
    Signed-off-by: Nathan Chancellor
    Signed-off-by: David S. Miller

    Nathan Chancellor
     

09 Nov, 2018

2 commits

  • draft-ietf-nvo3-geneve-08 says:

    It is strongly RECOMMENDED that Path MTU Discovery ([RFC1191],
    [RFC1981]) be used by setting the DF bit in the IP header when Geneve
    packets are transmitted over IPv4 (this is the default with IPv6).

    Now that ICMP error handling is working for GENEVE, we can comply with
    this recommendation.

    Make this configurable, though, to avoid breaking existing setups. By
    default, DF won't be set. It can be set or inherited from inner IPv4
    packets. If it's configured to be inherited and we are encapsulating IPv6,
    it will be set.

    This only applies to non-lwt tunnels: if an external control plane is
    used, tunnel key will still control the DF flag.

    v2:
    - DF behaviour configuration only applies for non-lwt tunnels, apply DF
    setting only if (!geneve->collect_md) in geneve_xmit_skb()
    (Stephen Hemminger)

    Signed-off-by: Stefano Brivio
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Stefano Brivio
     
  • Export an encap_err_lookup() operation to match an ICMP error against a
    valid VNI.

    Signed-off-by: Stefano Brivio
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Stefano Brivio
     

07 Nov, 2018

1 commit


20 Oct, 2018

1 commit

  • net/sched/cls_api.c has overlapping changes to a call to
    nlmsg_parse(), one (from 'net') added rtm_tca_policy instead of NULL
    to the 5th argument, and another (from 'net-next') added cb->extack
    instead of NULL to the 6th argument.

    net/ipv4/ipmr_base.c is a case of a bug fix in 'net' being done to
    code which moved (to mr_table_dump)) in 'net-next'. Thanks to David
    Ahern for the heads up.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Oct, 2018

2 commits

  • We shouldn't abuse exceptions: if the destination MTU is already higher
    than what we're transmitting, no exception should be created.

    Fixes: 52a589d51f10 ("geneve: update skb dst pmtu on tx path")
    Fixes: a93bf0ff4490 ("vxlan: update skb dst pmtu on tx path")
    Signed-off-by: Stefano Brivio
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Stefano Brivio
     
  • Commit f15ca723c1eb ("net: don't call update_pmtu unconditionally") avoids
    that we try updating PMTU for a non-existent destination, but didn't clean
    up cases where the check was already explicit. Drop those redundant checks.

    Signed-off-by: Stefano Brivio
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: David S. Miller

    Stefano Brivio
     

05 Oct, 2018

1 commit

  • As Michal remaind, we should allow to clear ttl inherit. Then we will
    have three states:

    1. set the flag, and do ttl inherit.
    2. do not set the flag, use configured ttl value, or default ttl (0) if
    not set.
    3. disable ttl inherit, use previous configured ttl value, or default ttl (0).

    Fixes: 52d0d404d39dd ("geneve: add ttl inherit support")
    CC: Michal Kubecek
    Signed-off-by: Hangbin Liu
    Signed-off-by: David S. Miller

    Hangbin Liu
     

13 Sep, 2018

1 commit

  • Similar with commit 72f6d71e491e6 ("vxlan: add ttl inherit support"),
    currently ttl == 0 means "use whatever default value" on geneve instead
    of inherit inner ttl. To respect compatibility with old behavior, let's
    add a new IFLA_GENEVE_TTL_INHERIT for geneve ttl inherit support.

    Reported-by: Jianlin Shi
    Suggested-by: Jiri Benc
    Signed-off-by: Hangbin Liu
    Reviewed-by: Jiri Benc
    Signed-off-by: David S. Miller

    Hangbin Liu
     

03 Jul, 2018

1 commit


02 Jul, 2018

1 commit

  • 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 5f114163f2f5 ("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: 5f114163f2f5 ("net: Add a skb_gro_flush_final helper.")
    Signed-off-by: Sabrina Dubroca
    Reviewed-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Sabrina Dubroca
     

29 Jun, 2018

1 commit

  • Check the tunnel option type stored in tunnel flags when creating options
    for tunnels. Thereby ensuring we do not set geneve, vxlan or erspan tunnel
    options on interfaces that are not associated with them.

    Make sure all users of the infrastructure set correct flags, for the BPF
    helper we have to set all bits to keep backward compatibility.

    Signed-off-by: Pieter Jansen van Vuuren
    Signed-off-by: Jakub Kicinski
    Signed-off-by: David S. Miller

    Pieter Jansen van Vuuren
     

26 Jun, 2018

1 commit

  • 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: David S. Miller

    David Miller
     

20 Apr, 2018

4 commits

  • Currently, on a new link creation or when 'remote' address parameter
    is updated, an MTU is not changed and always equals 1500. When a lower
    device has a larger MTU, it might not be efficient, e.g. for UDP, and
    requires the manual MTU adjustments to match the MTU of the lower
    device.

    This patch tries to automate this process, finds a lower device using
    the 'remote' address parameter, then uses its MTU to tune GENEVE's MTU:
    * on a new link creation
    * when 'remote' parameter is changed

    Also with this patch, the MTU from a user, on a new link creation, is
    passed to geneve_change_mtu() where it is verified, and MTU adjustments
    with a lower device is skipped in that case. Prior that change, it was
    possible to set the invalid MTU values on a new link creation.

    Signed-off-by: Alexey Kodanev
    Signed-off-by: David S. Miller

    Alexey Kodanev
     
  • geneve_change_mtu() will be used not only as ndo_change_mtu() callback,
    but also to verify a user specified MTU on a new link creation in the
    next patch.

    Signed-off-by: Alexey Kodanev
    Signed-off-by: David S. Miller

    Alexey Kodanev
     
  • Use ETH_HLEN instead and introduce two new macros: GENEVE_IPV4_HLEN
    and GENEVE_IPV6_HLEN that include Ethernet header length, corresponded
    IP header length and GENEVE_BASE_HLEN.

    Signed-off-by: Alexey Kodanev
    Signed-off-by: David S. Miller

    Alexey Kodanev
     
  • Signed-off-by: Alexey Kodanev
    Signed-off-by: David S. Miller

    Alexey Kodanev
     

29 Jan, 2018

1 commit


26 Jan, 2018

1 commit

  • Some dst_ops (e.g. md_dst_ops)) doesn't set this handler. It may result to:
    "BUG: unable to handle kernel NULL pointer dereference at (null)"

    Let's add a helper to check if update_pmtu is available before calling it.

    Fixes: 52a589d51f10 ("geneve: update skb dst pmtu on tx path")
    Fixes: a93bf0ff4490 ("vxlan: update skb dst pmtu on tx path")
    CC: Roman Kapl
    CC: Xin Long
    Signed-off-by: Nicolas Dichtel
    Signed-off-by: David S. Miller

    Nicolas Dichtel
     

09 Jan, 2018

1 commit


03 Jan, 2018

1 commit

  • Commit a93bf0ff4490 ("vxlan: update skb dst pmtu on tx path") has fixed
    a performance issue caused by the change of lower dev's mtu for vxlan.

    The same thing needs to be done for geneve as well.

    Note that geneve cannot adjust it's mtu according to lower dev's mtu
    when creating it. The performance is very low later when netperfing
    over it without fixing the mtu manually. This patch could also avoid
    this issue.

    Signed-off-by: Xin Long
    Signed-off-by: David S. Miller

    Xin Long
     

19 Dec, 2017

1 commit


24 Nov, 2017

1 commit

  • Stefano pointed that configure or show UDP_ZERO_CSUM6_RX/TX info doesn't
    make sense if we haven't enabled CONFIG_IPV6. Fix it by adding
    if IS_ENABLED(CONFIG_IPV6) check.

    Fixes: abe492b4f50c ("geneve: UDP checksum configuration via netlink")
    Fixes: fd7eafd02121 ("geneve: fix fill_info when link down")
    Signed-off-by: Hangbin Liu
    Reviewed-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Hangbin Liu
     

15 Nov, 2017

1 commit

  • geneve->sock4/6 were added with geneve_open and released with geneve_stop.
    So when geneve link down, we will not able to show remote address and
    checksum info after commit 11387fe4a98 ("geneve: fix fill_info when using
    collect_metadata").

    Fix this by avoid passing *_REMOTE{,6} for COLLECT_METADATA since they are
    mutually exclusive, and always show UDP_ZERO_CSUM6_RX info.

    Fixes: 11387fe4a98 ("geneve: fix fill_info when using collect_metadata")
    Signed-off-by: Hangbin Liu
    Signed-off-by: David S. Miller

    Hangbin Liu
     

14 Nov, 2017

1 commit


22 Oct, 2017

2 commits

  • There were quite a few overlapping sets of changes here.

    Daniel's bug fix for off-by-ones in the new BPF branch instructions,
    along with the added allowances for "data_end > ptr + x" forms
    collided with the metadata additions.

    Along with those three changes came veritifer test cases, which in
    their final form I tried to group together properly. If I had just
    trimmed GIT's conflict tags as-is, this would have split up the
    meta tests unnecessarily.

    In the socketmap code, a set of preemption disabling changes
    overlapped with the rename of bpf_compute_data_end() to
    bpf_compute_data_pointers().

    Changes were made to the mv88e6060.c driver set addr method
    which got removed in net-next.

    The hyperv transport socket layer had a locking change in 'net'
    which overlapped with a change of socket state macro usage
    in 'net-next'.

    Signed-off-by: David S. Miller

    David S. Miller
     
  • No need to re-invent memchr_inv() with !is_all_zero(). While at
    it, replace conditional and return clauses with a single return
    clause in is_tnl_info_zero().

    Signed-off-by: Stefano Brivio
    Signed-off-by: David S. Miller

    Stefano Brivio
     

21 Oct, 2017

1 commit

  • On big-endian machines, functions converting between tunnel ID
    and VNI use the three LSBs of tunnel ID storage to map VNI.

    The comparison function eq_tun_id_and_vni(), on the other hand,
    attempted to map the VNI from the three MSBs. Fix it by using
    the same check implemented on LE, which maps VNI from the three
    LSBs of tunnel ID.

    Fixes: 2e0b26e10352 ("geneve: Optimize geneve device lookup.")
    Signed-off-by: Stefano Brivio
    Reviewed-by: Jakub Sitnicki
    Signed-off-by: David S. Miller

    Stefano Brivio
     

12 Aug, 2017

1 commit

  • Add extack error messages for failure paths while creating/modifying
    geneve devices. Once extack support is added to iproute2, more
    meaningful and helpful error messages will be displayed making it easy
    for users to discern what went wrong.

    Before:

    =======
    $ ip link add gen1 address 0:1:2:3:4:5:6 type geneve id 200 \
    remote 192.168.13.2
    RTNETLINK answers: Invalid argument

    After:
    ======
    $ ip link add gen1 address 0:1:2:3:4:5:6 type geneve id 200 \
    remote 192.168.13.2
    Error: Provided link layer address is not Ethernet

    Also, netdev_dbg() calls used to log errors associated with Netlink
    request have been removed.

    Signed-off-by: Girish Moodalbail
    Signed-off-by: David S. Miller

    Girish Moodalbail
     

11 Aug, 2017

1 commit