Allow checking SYN cookies from XDP and tc cls act
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest8 patches 2 repliesIn review
- v2 posting 2/28 patches 6 repliesSuperseded
- v2 posting 1/28 patches 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 5 replies | Superseded |
Changes in v3 from the cover letter
* Fix missing check for ip4->ihl
* Only cast to unsigned long in BPF_CALLs
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | bpf: track references based on is_acquire_funckernel/ | +12 | 0 replies | |
| 2/8 | bpf: allow helpers to return PTR_TO_SOCK_COMMONinclude/ kernel/ | +5 | 0 replies | |
| 3/8 | bpf: add skc_lookup_tcp helperinclude/ kernel/ net/ | +143 | 0 replies | |
| 4/8 | bpf: add helper to check for a valid SYN cookieinclude/ net/ | +89 | 2 replies | |
| 5/8 | tools: update include/uapi/linux/bpf.htools/ | +35 | 0 replies | |
| 6/8 | selftests/bpf: allow specifying helper for BPF_SK_LOOKUPtools/ tools/ tools/ | +46 | 0 replies | |
| 7/8 | selftests/bpf: test references to sock_commontools/ | +48 | 0 replies | |
| 8/8 | selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcptools/ tools/ tools/ +3 more | +434 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH bpf-next v3 0/8] Allow checking SYN cookies from XDP and tc cls act
This series adds the necessary helpers to determine wheter a given (encapsulated) TCP packet belongs to a connection known to the network stack.
* bpf_skc_lookup_tcp gives access to request and timewait sockets
* bpf_tcp_check_syncookie identifies the final 3WHS ACK when syncookies are enabled
The goal is to be able to implement load-balancing approaches like glb-director [1] or Beamer [2] in pure eBPF. Specifically, we'd like to replace the functionality of the glb-redirect kernel module [3] by an XDP program or tc classifier.
Changes in v3:
* Fix missing check for ip4->ihl
* Only cast to unsigned long in BPF_CALLs
Changes in v2:
* Rename bpf_sk_check_syncookie to bpf_tcp_check_syncookie.
* Add bpf_skc_lookup_tcp. Without it bpf_tcp_check_syncookie doesn't make sense.
* Check tcp_synq_no_recent_overflow() in bpf_tcp_check_syncookie.
* Check th->syn in bpf_tcp_check_syncookie.
* Require CONFIG_IPV6 to be a built in.
1: https://github.com/github/glb-director
2: https://www.usenix.org/conference/nsdi18/presentation/olteanu
3: https://github.com/github/glb-director/tree/master/src/glb-redirect
Lorenz Bauer (8):
bpf: track references based on is_acquire_func
bpf: allow helpers to return PTR_TO_SOCK_COMMON
bpf: add skc_lookup_tcp helper
bpf: add helper to check for a valid SYN cookie
tools: update include/uapi/linux/bpf.h selftests/bpf: allow specifying helper for BPF_SK_LOOKUP selftests/bpf: test references to sock_common selftests/bpf: add tests for bpf_tcp_check_syncookie and
bpf_skc_lookup_tcp
include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 36 ++- kernel/bpf/verifier.c | 33 +-- net/core/filter.c | 216 ++++++++++++++++-- tools/include/uapi/linux/bpf.h | 36 ++- tools/testing/selftests/bpf/.gitignore | 1 + tools/testing/selftests/bpf/Makefile | 5 +- tools/testing/selftests/bpf/bpf_helpers.h | 8 + .../bpf/progs/test_tcp_check_syncookie_kern.c | 129 +++++++++++ .../selftests/bpf/test_tcp_check_syncookie.sh | 81 +++++++ .../bpf/test_tcp_check_syncookie_user.c | 212 +++++++++++++++++ tools/testing/selftests/bpf/test_verifier.c | 6 +- .../selftests/bpf/verifier/ref_tracking.c | 126 ++++++---- tools/testing/selftests/bpf/verifier/unpriv.c | 8 +- 14 files changed, 811 insertions(+), 87 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_tcp_check_syncookie_kern.c create mode 100755 tools/testing/selftests/bpf/test_tcp_check_syncookie.sh create mode 100644 tools/testing/selftests/bpf/test_tcp_check_syncookie_user.c
--
2.19.1