diff options
| author | Lorenz Bauer <[email protected]> | 2020-09-28 09:08:02 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-09-28 23:40:46 +0000 |
| commit | 6550f2dddfab02a5b948369eeeaedfbc4ae3cc16 (patch) | |
| tree | 30313e28f6393c2d0d7a65ceca78c9f6a1a81dc3 /tools/testing/selftests/bpf/prog_tests/sockmap_basic.c | |
| parent | bpf, cpumap: Remove rcpu pointer from cpu_map_build_skb signature (diff) | |
| download | kernel-6550f2dddfab02a5b948369eeeaedfbc4ae3cc16.tar.gz kernel-6550f2dddfab02a5b948369eeeaedfbc4ae3cc16.zip | |
bpf: sockmap: Enable map_update_elem from bpf_iter
Allow passing a pointer to a BTF struct sock_common* when updating
a sockmap or sockhash. Since BTF pointers can fault and therefore be
NULL at runtime we need to add an additional !sk check to
sock_map_update_elem. Since we may be passed a request or timewait
socket we also need to check sk_fullsock. Doing this allows calling
map_update_elem on sockmap from bpf_iter context, which uses
BTF pointers.
Signed-off-by: Lorenz Bauer <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/sockmap_basic.c')
0 files changed, 0 insertions, 0 deletions
