Skip to content

sockmap fixes/improvments for bpf-next

John Fastabend netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8bpf: sk_msg, fix sk_msg_md access past end testtools/testing/selftests/bpf/test_verifier.c+1 -10 replies
2/8bpf: sk_msg, improve offset chk in _is_valid_accessnet/core/filter.c+14 -70 replies
3/8bpf: skmsg, replace comments with BUILD buginclude/linux/skmsg.h net/core/filter.c+4 -30 replies
4/8bpf: skb_verdict, support SK_PASS on RX BPF pathnet/core/skmsg.c+16 -00 replies
5/8bpf: sk_msg, fix socket data_ready eventsinclude/linux/skmsg.h net/core/skmsg.c net/ipv4/tcp_bpf.c+12 -40 replies
6/8bpf: sk_msg, zap ingress queue on psock downnet/core/skmsg.c+1 -00 replies
7/8bpf: sk_msg, sock{map|hash} redirect through ULPinclude/linux/socket.h include/net/tls.h net/ipv4/tcp_bpf.c +1 more+52 -140 replies
8/8bpf: tls_sw, init TLS ULP removes BPF proto hooksnet/tls/tls_main.c+12 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/8] sockmap fixes/improvments for bpf-next

Set of bpf fixes and improvements to make sockmap with kTLS usable with "real" applications. This set came as the fallout of pulling kTLS+sockmap into Cilium[1] and running in container environment.

Roughly broken into three parts,

Patches 1-3: resolve/improve handling of size field in sk_msg_md
Patch 4: it became difficult to use this in Cilium when the
SK_PASS verdict was not correctly handle. So handle the case correctly.
Patch 5-8: Set of issues found while running OpenSSL TX kTLS
enabled applications. This resolves the most obvious issues and gets applications using kTLS TX up and running with sock{map|has}.

Other than the "sk_msg, zap ingress queue on psock down" (PATCH 6/8) which can potentially cause a WARNING the issues fixed in this series do not cause kernel side warnings, BUG, etc. but instead cause stalls and other odd behavior in the user space applications when using kTLS with BPF policies applied.

Primarily tested with 'curl' compiled with latest openssl and also 'openssl s_client/s_server' containers using Cilium network plugin with docker/k8s. Some basic testing with httpd was also enabled. Cilium CI tests will be added shortly to cover these cases as well. We also have 'wrk' and other test and benchmarking tools we can run now.

We have two more sets of patches currently under testing that will be sent shortly to address a few more issues. First the OpenSSL RX kTLS side breaks when both sk_msg and sk_skb_verdict programs are used with kTLS, the sk_skb_verdict programs are not enforced. Second skmsg needs to call into tcp stack to send to indicate consumed data.

Thanks,
John

John Fastabend (8):
bpf: sk_msg, fix sk_msg_md access past end test
bpf: sk_msg, make offset check in sk_msg_is_valid_access more robust
bpf: skmsg, replace comments with BUILD bug to avoid any future errors
bpf: sk_skb_verdict, support SK_PASS on RX BPF path
bpf: sk_msg, fix socket data_ready events
bpf: sk_msg, zap ingress queue on psock down
bpf: sk_msg, sock{map|hash} redirect through ULP
bpf: tls_sw, initializing TLS ULP removes existing BPF proto hooks

 include/linux/skmsg.h                       | 12 ++++++---
 include/linux/socket.h                      |  1 +
 include/net/tls.h                           |  9 +++++++
 net/core/filter.c                           | 24 ++++++++++++-----
 net/core/skmsg.c                            | 23 +++++++++++++---
 net/ipv4/tcp_bpf.c                          | 14 ++++++++--
 net/tls/tls_main.c                          | 14 ++++++++--
 net/tls/tls_sw.c                            | 42 ++++++++++++++++++++---------
 tools/testing/selftests/bpf/test_verifier.c |  2 +-
 9 files changed, 111 insertions(+), 30 deletions(-)
Signature · 1 line
2.7.4