diff options
| author | Kuniyuki Iwashima <[email protected]> | 2024-01-15 20:55:11 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-01-23 22:40:24 +0000 |
| commit | 8b5ac68fb5ee416537c1214cbacf0ddc4293cce9 (patch) | |
| tree | b34d2e597746829ffeb492a42a3532605e5ddb3c /tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c | |
| parent | tcp: Move skb_steal_sock() to request_sock.h (diff) | |
| download | kernel-8b5ac68fb5ee416537c1214cbacf0ddc4293cce9.tar.gz kernel-8b5ac68fb5ee416537c1214cbacf0ddc4293cce9.zip | |
bpf: tcp: Handle BPF SYN Cookie in skb_steal_sock().
We will support arbitrary SYN Cookie with BPF.
If BPF prog validates ACK and kfunc allocates a reqsk, it will
be carried to TCP stack as skb->sk with req->syncookie 1. Also,
the reqsk has its listener as req->rsk_listener with no refcnt
taken.
When the TCP stack looks up a socket from the skb, we steal
inet_reqsk(skb->sk)->rsk_listener in skb_steal_sock() so that
the skb will be processed in cookie_v[46]_check() with the
listener.
Note that we do not clear skb->sk and skb->destructor so that we
can carry the reqsk to cookie_v[46]_check().
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_tcp_custom_syncookie.c')
0 files changed, 0 insertions, 0 deletions
