Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add skb_adjust_room() for SK_SKB #154

Closed
wants to merge 3 commits into from

Commits on Oct 2, 2020

  1. adding ci files

    kernel-patches-bot committed Oct 2, 2020
    Configuration menu
    Copy the full SHA
    78660c2 View commit details
    Browse the repository at this point in the history
  2. bpf, sockmap: add skb_adjust_room to pop bytes off ingress payload

    This implements a new helper skb_adjust_room() so users can push/pop
    extra bytes from a BPF_SK_SKB_STREAM_VERDICT program.
    
    Some protocols may include headers and other information that we may
    not want to include when doing a redirect from a BPF_SK_SKB_STREAM_VERDICT
    program. One use case is to redirect TLS packets into a receive socket
    that doesn't expect TLS data. In TLS case the first 13B or so contain the
    protocol header. With KTLS the payload is decrypted so we should be able
    to redirect this to a receiving socket, but the receiving socket may not
    be expecting to receive a TLS header and discard the data. Using the
    above helper we can pop the header off and put an appropriate header on
    the payload. This allows for creating a proxy between protocols without
    extra hops through the stack or userspace.
    
    So in order to fix this case add skb_adjust_room() so users can strip the
    header. After this the user can strip the header and an unmodified receiver
    thread will work correctly when data is redirected into the ingress path
    of a sock.
    
    Signed-off-by: John Fastabend <john.fastabend@gmail.com>
    jrfastab authored and kernel-patches-bot committed Oct 2, 2020
    Configuration menu
    Copy the full SHA
    d14d28f View commit details
    Browse the repository at this point in the history
  3. bpf, sockmap: update selftests to use skb_adjust_room

    Instead of working around TLS headers in sockmap selftests use the
    new skb_adjust_room helper. This allows us to avoid special casing
    the receive side to skip headers.
    
    Signed-off-by: John Fastabend <john.fastabend@gmail.com>
    jrfastab authored and kernel-patches-bot committed Oct 2, 2020
    Configuration menu
    Copy the full SHA
    62ffcf2 View commit details
    Browse the repository at this point in the history