diff options
| author | Jakub Sitnicki <[email protected]> | 2020-02-18 17:10:18 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2020-02-21 21:29:45 +0000 |
| commit | c1cdf65da060a8e047a9f4433306fd6dac1f51a6 (patch) | |
| tree | ec77dc322cb1085437d4e63ee2c19d6958297ac4 /scripts/bpf_helpers_doc.py | |
| parent | bpf, sockmap: Don't set up upcalls and progs for listening sockets (diff) | |
| download | kernel-c1cdf65da060a8e047a9f4433306fd6dac1f51a6.tar.gz kernel-c1cdf65da060a8e047a9f4433306fd6dac1f51a6.zip | |
bpf, sockmap: Return socket cookie on lookup from syscall
Tooling that populates the SOCK{MAP,HASH} with sockets from user-space
needs a way to inspect its contents. Returning the struct sock * that the
map holds to user-space is neither safe nor useful. An approach established
by REUSEPORT_SOCKARRAY is to return a socket cookie (a unique identifier)
instead.
Since socket cookies are u64 values, SOCK{MAP,HASH} need to support such a
value size for lookup to be possible. This requires special handling on
update, though. Attempts to do a lookup on a map holding u32 values will be
met with ENOSPC error.
Signed-off-by: Jakub Sitnicki <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: John Fastabend <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'scripts/bpf_helpers_doc.py')
0 files changed, 0 insertions, 0 deletions
