12 Jun, 2019

1 commit

  • net/xfrm/xfrm_input.c:378:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
    skb->protocol = htons(ETH_P_IPV6);

    ... the fallthrough then causes a bogus WARN_ON().

    Reported-by: Stephen Rothwell
    Fixes: 4c203b0454b ("xfrm: remove eth_proto value from xfrm_state_afinfo")
    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

06 Jun, 2019

1 commit

  • xfrm_prepare_input needs to lookup the state afinfo backend again to fetch
    the address family ethernet protocol value.

    There are only two address families, so a switch statement is simpler.
    While at it, use u8 for family and proto and remove the owner member --
    its not used anywhere.

    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

08 Apr, 2019

6 commits

  • This structure is now only 4 bytes, so its more efficient
    to cache a copy rather than its address.

    No significant size difference in allmodconfig vmlinux.

    With non-modular kernel that has all XFRM options enabled, this
    series reduces vmlinux image size by ~11kb. All xfrm_mode
    indirections are gone and all modes are built-in.

    before (ipsec-next master):
    text data bss dec filename
    21071494 7233140 11104324 39408958 vmlinux.master

    after this series:
    21066448 7226772 11104324 39397544 vmlinux.patched

    With allmodconfig kernel, the size increase is only 362 bytes,
    even all the xfrm config options removed in this series are
    modular.

    before:
    text data bss dec filename
    15731286 6936912 4046908 26715106 vmlinux.master

    after this series:
    15731492 6937068 4046908 26715468 vmlinux

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • after previous changes, xfrm_mode contains no function pointers anymore
    and all modules defining such struct contain no code except an init/exit
    functions to register the xfrm_mode struct with the xfrm core.

    Just place the xfrm modes core and remove the modules,
    the run-time xfrm_mode register/unregister functionality is removed.

    Before:

    text data bss dec filename
    7523 200 2364 10087 net/xfrm/xfrm_input.o
    40003 628 440 41071 net/xfrm/xfrm_state.o
    15730338 6937080 4046908 26714326 vmlinux

    7389 200 2364 9953 net/xfrm/xfrm_input.o
    40574 656 440 41670 net/xfrm/xfrm_state.o
    15730084 6937068 4046908 26714060 vmlinux

    The xfrm*_mode_{transport,tunnel,beet} modules are gone.

    v2: replace CONFIG_INET6_XFRM_MODE_* IS_ENABLED guards with CONFIG_IPV6
    ones rather than removing them.

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • Adds an EXPORT_SYMBOL for afinfo_get_rcu, as it will now be called from
    ipv6 in case of CONFIG_IPV6=m.

    This change has virtually no effect on vmlinux size, but it reduces
    afinfo size and allows followup patch to make xfrm modes const.

    v2: mark if (afinfo) tests as likely (Sabrina)
    re-fetch afinfo according to inner_mode in xfrm_prepare_input().

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • No external dependencies on any module, place this in the core.
    Increase is about 1800 byte for xfrm_input.o.

    The beet helpers get added to internal header, as they can be reused
    from xfrm_output.c in the next patch (kernel contains several
    copies of them in the xfrm{4,6}_mode_beet.c files).

    Before:
    text data bss dec filename
    5578 176 2364 8118 net/xfrm/xfrm_input.o
    1180 64 0 1244 net/ipv4/xfrm4_mode_beet.o
    171 40 0 211 net/ipv4/xfrm4_mode_transport.o
    1163 40 0 1203 net/ipv4/xfrm4_mode_tunnel.o
    1083 52 0 1135 net/ipv6/xfrm6_mode_beet.o
    172 40 0 212 net/ipv6/xfrm6_mode_ro.o
    172 40 0 212 net/ipv6/xfrm6_mode_transport.o
    1056 40 0 1096 net/ipv6/xfrm6_mode_tunnel.o

    After:
    text data bss dec filename
    7373 200 2364 9937 net/xfrm/xfrm_input.o
    587 44 0 631 net/ipv4/xfrm4_mode_beet.o
    171 32 0 203 net/ipv4/xfrm4_mode_transport.o
    649 32 0 681 net/ipv4/xfrm4_mode_tunnel.o
    625 44 0 669 net/ipv6/xfrm6_mode_beet.o
    172 32 0 204 net/ipv6/xfrm6_mode_ro.o
    172 32 0 204 net/ipv6/xfrm6_mode_transport.o
    599 32 0 631 net/ipv6/xfrm6_mode_tunnel.o

    v2: pass inner_mode to xfrm_inner_mode_encap_remove to fix
    AF_UNSPEC selector breakage (bisected by Benedict Wong)

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • No need for any indirection or abstraction here, both functions
    are pretty much the same and quite small, they also have no external
    dependencies.

    xfrm_prepare_input can then be made static.

    With allmodconfig build, size increase of vmlinux is 25 byte:

    Before:
    text data bss dec filename
    15730207 6936924 4046908 26714039 vmlinux

    After:
    15730208 6936948 4046908 26714064 vmlinux

    v2: Fix INET_XFRM_MODE_TRANSPORT name in is-enabled test (Sabrina Dubroca)
    change copied comment to refer to transport and network header,
    not skb->{h,nh}, which don't exist anymore. (Sabrina)
    make xfrm_prepare_input static (Eyal Birger)

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • Now that we have the family available directly in the
    xfrm_mode struct, we can use that and avoid one extra dereference.

    Signed-off-by: Florian Westphal
    Reviewed-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Florian Westphal
     

21 Dec, 2018

1 commit


20 Dec, 2018

3 commits

  • Remove skb->sp and allocate secpath storage via extension
    infrastructure. This also reduces sk_buff by 8 bytes on x86_64.

    Total size of allyesconfig kernel is reduced slightly, as there is
    less inlined code (one conditional atomic op instead of two on
    skb_clone).

    No differences in throughput in following ipsec performance tests:
    - transport mode with aes on 10GB link
    - tunnel mode between two network namespaces with aes and null cipher

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • skb_sec_path gains 'const' qualifier to avoid
    xt_policy.c: 'skb_sec_path' discards 'const' qualifier from pointer target type

    same reasoning as previous conversions: Won't need to touch these
    spots anymore when skb->sp is removed.

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     
  • It can only return 0 (success) or -ENOMEM.
    Change return value to a pointer to secpath struct.

    This avoids direct access to skb->sp:

    err = secpath_set(skb);
    if (!err) ..
    skb->sp-> ...

    Becomes:
    sp = secpath_set(skb)
    if (!sp) ..
    sp-> ..

    This reduces noise in followup patch which is going to remove skb->sp.

    Signed-off-by: Florian Westphal
    Signed-off-by: David S. Miller

    Florian Westphal
     

22 Nov, 2018

1 commit

  • Since commit 222d7dbd258d ("net: prevent dst uses after free")
    skb_dst_force() might clear the dst_entry attached to the skb.
    The xfrm code doesn't expect this to happen, so we crash with
    a NULL pointer dereference in this case.

    Fix it by checking skb_dst(skb) for NULL after skb_dst_force()
    and drop the packet in case the dst_entry was cleared. We also
    move the skb_dst_force() to a codepath that is not used when
    the transformation was offloaded, because in this case we
    don't have a dst_entry attached to the skb.

    The output and forwarding path was already fixed by
    commit 9e1437937807 ("xfrm: Fix NULL pointer dereference when
    skb_dst_force clears the dst_entry.")

    Fixes: 222d7dbd258d ("net: prevent dst uses after free")
    Reported-by: Jean-Philippe Menil
    Signed-off-by: Steffen Klassert

    Steffen Klassert
     

08 Oct, 2018

1 commit

  • This place should want to initialize array, not a element,
    so it should be sizeof(array) instead of sizeof(element)

    but now this array only has one element, so no error in
    this condition that XFRM_MAX_OFFLOAD_DEPTH is 1

    Signed-off-by: Li RongQing
    Signed-off-by: Steffen Klassert

    Li RongQing
     

02 Oct, 2018

1 commit

  • Steffen Klassert says:

    ====================
    pull request (net): ipsec 2018-10-01

    1) Validate address prefix lengths in the xfrm selector,
    otherwise we may hit undefined behaviour in the
    address matching functions if the prefix is too
    big for the given address family.

    2) Fix skb leak on local message size errors.
    From Thadeu Lima de Souza Cascardo.

    3) We currently reset the transport header back to the network
    header after a transport mode transformation is applied. This
    leads to an incorrect transport header when multiple transport
    mode transformations are applied. Reset the transport header
    only after all transformations are already applied to fix this.
    From Sowmini Varadhan.

    4) We only support one offloaded xfrm, so reset crypto_done after
    the first transformation in xfrm_input(). Otherwise we may call
    the wrong input method for subsequent transformations.
    From Sowmini Varadhan.

    5) Fix NULL pointer dereference when skb_dst_force clears the dst_entry.
    skb_dst_force does not really force a dst refcount anymore, it might
    clear it instead. xfrm code did not expect this, add a check to not
    dereference skb_dst() if it was cleared by skb_dst_force.

    6) Validate xfrm template mode, otherwise we can get a stack-out-of-bounds
    read in xfrm_state_find. From Sean Tranchetti.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

04 Sep, 2018

1 commit

  • We only support one offloaded xfrm (we do not have devices that
    can handle more than one offload), so reset crypto_done in
    xfrm_input() when iterating over multiple transforms in xfrm_input,
    so that we can invoke the appropriate x->type->input for the
    non-offloaded transforms

    Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
    Signed-off-by: Sowmini Varadhan
    Signed-off-by: Steffen Klassert

    Sowmini Varadhan
     

23 Jun, 2018

2 commits

  • This patch adds support for virtual xfrm interfaces.
    Packets that are routed through such an interface
    are guaranteed to be IPsec transformed or dropped.
    It is a generic virtual interface that ensures IPsec
    transformation, no need to know what happens behind
    the interface. This means that we can tunnel IPv4 and
    IPv6 through the same interface and support all xfrm
    modes (tunnel, transport and beet) on it.

    Co-developed-by: Lorenzo Colitti
    Co-developed-by: Benedict Wong
    Signed-off-by: Lorenzo Colitti
    Signed-off-by: Benedict Wong
    Signed-off-by: Steffen Klassert
    Acked-by: Shannon Nelson
    Tested-by: Benedict Wong
    Tested-by: Antony Antony
    Reviewed-by: Eyal Birger

    Steffen Klassert
     
  • We already support setting an output mark at the xfrm_state,
    unfortunately this does not support the input direction and
    masking the marks that will be applied to the skb. This change
    adds support applying a masked value in both directions.

    The existing XFRMA_OUTPUT_MARK number is reused for this purpose
    and as it is now bi-directional, it is renamed to XFRMA_SET_MARK.

    An additional XFRMA_SET_MARK_MASK attribute is added for setting the
    mask. If the attribute mask not provided, it is set to 0xffffffff,
    keeping the XFRMA_OUTPUT_MARK existing 'full mask' semantics.

    Co-developed-by: Tobias Brunner
    Co-developed-by: Eyal Birger
    Co-developed-by: Lorenzo Colitti
    Signed-off-by: Steffen Klassert
    Signed-off-by: Tobias Brunner
    Signed-off-by: Eyal Birger
    Signed-off-by: Lorenzo Colitti

    Steffen Klassert
     

02 Apr, 2018

1 commit


23 Mar, 2018

1 commit

  • A recent commit introduced a new struct xfrm_trans_cb
    that is used with the sk_buff control buffer. Unfortunately
    it placed the structure in front of the control buffer and
    overlooked that the IPv4/IPv6 control buffer is still needed
    for some layer 4 protocols. As a result the IPv4/IPv6 control
    buffer is overwritten with this structure. Fix this by setting
    a apropriate header in front of the structure.

    Fixes acf568ee859f ("xfrm: Reinject transport-mode packets ...")
    Signed-off-by: Steffen Klassert

    Steffen Klassert
     

27 Feb, 2018

1 commit


17 Jan, 2018

1 commit


05 Jan, 2018

1 commit

  • We do not need locking in xfrm_trans_queue because it is designed
    to use per-CPU buffers. However, the original code incorrectly
    used skb_queue_tail which takes the lock. This patch switches
    it to __skb_queue_tail instead.

    Reported-and-tested-by: Artem Savkov
    Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets...")
    Signed-off-by: Herbert Xu
    Signed-off-by: Steffen Klassert

    Herbert Xu
     

30 Dec, 2017

1 commit


19 Dec, 2017

1 commit

  • This is an old bugbear of mine:

    https://www.mail-archive.com/netdev@vger.kernel.org/msg03894.html

    By crafting special packets, it is possible to cause recursion
    in our kernel when processing transport-mode packets at levels
    that are only limited by packet size.

    The easiest one is with DNAT, but an even worse one is where
    UDP encapsulation is used in which case you just have to insert
    an UDP encapsulation header in between each level of recursion.

    This patch avoids this problem by reinjecting tranport-mode packets
    through a tasklet.

    Fixes: b05e106698d9 ("[IPV4/6]: Netfilter IPsec input hooks")
    Signed-off-by: Herbert Xu
    Signed-off-by: Steffen Klassert

    Herbert Xu
     

01 Dec, 2017

2 commits


09 Nov, 2017

1 commit

  • Steffen Klassert says:

    ====================
    pull request (net): ipsec 2017-11-09

    1) Fix a use after free due to a reallocated skb head.
    From Florian Westphal.

    2) Fix sporadic lookup failures on labeled IPSEC.
    From Florian Westphal.

    3) Fix a stack out of bounds when a socket policy is applied
    to an IPv6 socket that sends IPv4 packets.

    Please pull or let me know if there are problems.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

02 Nov, 2017

2 commits

  • syzbot reports:
    BUG: KASAN: use-after-free in __xfrm_state_lookup+0x695/0x6b0
    Read of size 4 at addr ffff8801d434e538 by task syzkaller647520/2991
    [..]
    __xfrm_state_lookup+0x695/0x6b0 net/xfrm/xfrm_state.c:833
    xfrm_state_lookup+0x8a/0x160 net/xfrm/xfrm_state.c:1592
    xfrm_input+0x8e5/0x22f0 net/xfrm/xfrm_input.c:302

    The use-after-free is the ipv4 destination address, which points
    to an skb head area that has been reallocated:
    pskb_expand_head+0x36b/0x1210 net/core/skbuff.c:1494
    __pskb_pull_tail+0x14a/0x17c0 net/core/skbuff.c:1877
    pskb_may_pull include/linux/skbuff.h:2102 [inline]
    xfrm_parse_spi+0x3d3/0x4d0 net/xfrm/xfrm_input.c:170
    xfrm_input+0xce2/0x22f0 net/xfrm/xfrm_input.c:291

    so the real bug is that xfrm_parse_spi() uses pskb_may_pull, but
    for now do smaller workaround that makes xfrm_input fetch daddr
    after spi parsing.

    Reported-by: syzbot
    Signed-off-by: Florian Westphal
    Signed-off-by: Steffen Klassert

    Florian Westphal
     
  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Sep, 2017

1 commit

  • Can be reproduced with LTP tests:
    # icmp-uni-vti.sh -p ah -a sha256 -m tunnel -S fffffffe -k 1 -s 10

    IPv4:
    RIP: 0010:xfrm_input+0x7f9/0x870
    ...
    Call Trace:

    vti_input+0xaa/0x110 [ip_vti]
    ? skb_free_head+0x21/0x40
    vti_rcv+0x33/0x40 [ip_vti]
    xfrm4_ah_rcv+0x33/0x60
    ip_local_deliver_finish+0x94/0x1e0
    ip_local_deliver+0x6f/0xe0
    ? ip_route_input_noref+0x28/0x50
    ...

    # icmp-uni-vti.sh -6 -p ah -a sha256 -m tunnel -S fffffffe -k 1 -s 10
    IPv6:
    RIP: 0010:xfrm_input+0x7f9/0x870
    ...
    Call Trace:

    xfrm6_rcv_tnl+0x3c/0x40
    vti6_rcv+0xd5/0xe0 [ip6_vti]
    xfrm6_ah_rcv+0x33/0x60
    ip6_input_finish+0xee/0x460
    ip6_input+0x3f/0xb0
    ip6_rcv_finish+0x45/0xa0
    ipv6_rcv+0x34b/0x540

    xfrm_input() invokes xfrm_rcv_cb() -> vti_rcv_cb(), the last callback
    might call skb_scrub_packet(), which in turn can reset secpath.

    Fix it by adding a check that skb->sp is not NULL.

    Fixes: 7e9e9202bccc ("xfrm: Clear RX SKB secpath xfrm_offload")
    Signed-off-by: Alexey Kodanev
    Signed-off-by: Steffen Klassert

    Alexey Kodanev
     

31 Aug, 2017

1 commit

  • In conjunction with crypto offload [1], removing the ESP trailer by
    hardware can potentially improve the performance by avoiding (1) a
    cache miss incurred by reading the nexthdr field and (2) the necessity
    to calculate the csum value of the trailer in order to keep skb->csum
    valid.

    This patch introduces the changes to the xfrm stack and merely serves
    as an infrastructure. Subsequent patch to mlx5 driver will put this to
    a good use.

    [1] https://www.mail-archive.com/netdev@vger.kernel.org/msg175733.html

    Signed-off-by: Yossi Kuperman
    Signed-off-by: Steffen Klassert

    Yossi Kuperman
     

02 Aug, 2017

1 commit

  • If an incoming packet undergoes XFRM crypto-offload, its secpath is
    filled with xfrm_offload struct denoting offload information.

    If the SKB is then forwarded to a device which supports crypto-
    offload, the stack wrongfully attempts to offload it (even though
    the output SA may not exist on the device) due to the leftover
    secpath xo.

    Clear the ingress xo by zeroizing secpath->olen just before
    delivering the decapsulated packet to the network stack.

    Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
    Signed-off-by: Ilan Tayari
    Signed-off-by: Steffen Klassert

    Ilan Tayari
     

05 Jul, 2017

1 commit

  • refcount_t type and corresponding API should be
    used instead of atomic_t when the variable is used as
    a reference counter. This allows to avoid accidental
    refcounter overflows that might lead to use-after-free
    situations.

    Signed-off-by: Elena Reshetova
    Signed-off-by: Hans Liljestrand
    Signed-off-by: Kees Cook
    Signed-off-by: David Windsor
    Signed-off-by: David S. Miller

    Reshetova, Elena
     

03 May, 2017

1 commit

  • Pull networking updates from David Millar:
    "Here are some highlights from the 2065 networking commits that
    happened this development cycle:

    1) XDP support for IXGBE (John Fastabend) and thunderx (Sunil Kowuri)

    2) Add a generic XDP driver, so that anyone can test XDP even if they
    lack a networking device whose driver has explicit XDP support
    (me).

    3) Sparc64 now has an eBPF JIT too (me)

    4) Add a BPF program testing framework via BPF_PROG_TEST_RUN (Alexei
    Starovoitov)

    5) Make netfitler network namespace teardown less expensive (Florian
    Westphal)

    6) Add symmetric hashing support to nft_hash (Laura Garcia Liebana)

    7) Implement NAPI and GRO in netvsc driver (Stephen Hemminger)

    8) Support TC flower offload statistics in mlxsw (Arkadi Sharshevsky)

    9) Multiqueue support in stmmac driver (Joao Pinto)

    10) Remove TCP timewait recycling, it never really could possibly work
    well in the real world and timestamp randomization really zaps any
    hint of usability this feature had (Soheil Hassas Yeganeh)

    11) Support level3 vs level4 ECMP route hashing in ipv4 (Nikolay
    Aleksandrov)

    12) Add socket busy poll support to epoll (Sridhar Samudrala)

    13) Netlink extended ACK support (Johannes Berg, Pablo Neira Ayuso,
    and several others)

    14) IPSEC hw offload infrastructure (Steffen Klassert)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2065 commits)
    tipc: refactor function tipc_sk_recv_stream()
    tipc: refactor function tipc_sk_recvmsg()
    net: thunderx: Optimize page recycling for XDP
    net: thunderx: Support for XDP header adjustment
    net: thunderx: Add support for XDP_TX
    net: thunderx: Add support for XDP_DROP
    net: thunderx: Add basic XDP support
    net: thunderx: Cleanup receive buffer allocation
    net: thunderx: Optimize CQE_TX handling
    net: thunderx: Optimize RBDR descriptor handling
    net: thunderx: Support for page recycling
    ipx: call ipxitf_put() in ioctl error path
    net: sched: add helpers to handle extended actions
    qed*: Fix issues in the ptp filter config implementation.
    qede: Fix concurrency issue in PTP Tx path processing.
    stmmac: Add support for SIMATIC IOT2000 platform
    net: hns: fix ethtool_get_strings overflow in hns driver
    tcp: fix wraparound issue in tcp_lp
    bpf, arm64: fix jit branch offset related to ldimm64
    bpf, arm64: implement jiting of BPF_XADD
    ...

    Linus Torvalds
     

27 Apr, 2017

1 commit

  • In xfrm_input() when called from GRO, async == 0, and we end up
    skipping the processing in xfrm4_transport_finish(). GRO path will
    always skip the NF_HOOK, so we don't need the special-case for
    !NETFILTER during GRO processing.

    Fixes: 7785bba299a8 ("esp: Add a software GRO codepath")
    Signed-off-by: Sabrina Dubroca
    Signed-off-by: Steffen Klassert

    Sabrina Dubroca
     

14 Apr, 2017

2 commits

  • On IPsec hardware offloading, we already get a secpath with
    valid state attached when the packet enters the GRO handlers.
    So check for hardware offload and skip the state lookup in this
    case.

    Signed-off-by: Steffen Klassert

    Steffen Klassert
     
  • This patch adds all the bits that are needed to do
    IPsec hardware offload for IPsec states and ESP packets.
    We add xfrmdev_ops to the net_device. xfrmdev_ops has
    function pointers that are needed to manage the xfrm
    states in the hardware and to do a per packet
    offloading decision.

    Joint work with:
    Ilan Tayari
    Guy Shapiro
    Yossi Kuperman

    Signed-off-by: Guy Shapiro
    Signed-off-by: Ilan Tayari
    Signed-off-by: Yossi Kuperman
    Signed-off-by: Steffen Klassert

    Steffen Klassert
     

15 Feb, 2017

2 commits

  • This patch adds GRO ifrastructure and callbacks for ESP on
    ipv4 and ipv6.

    In case the GRO layer detects an ESP packet, the
    esp{4,6}_gro_receive() function does a xfrm state lookup
    and calls the xfrm input layer if it finds a matching state.
    The packet will be decapsulated and reinjected it into layer 2.

    Signed-off-by: Steffen Klassert

    Steffen Klassert
     
  • We need to keep per packet offloading informations across
    the layers. So we extend the sec_path to carry these for
    the input and output offload codepath.

    Signed-off-by: Steffen Klassert

    Steffen Klassert