diff options
author | John Fastabend <john.fastabend@gmail.com> | 2021-11-03 13:47:32 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2021-11-09 00:56:35 +0100 |
commit | 40a34121ac1dc52ed9cd34a8f4e48e32517a52fd (patch) | |
tree | 8e913e6d58d17d6ec21021ac48a05e5b636f615c /CREDITS | |
parent | 47b3708c6088a60e7dc3b809dbb0d4c46590b32f (diff) | |
download | linux-40a34121ac1dc52ed9cd34a8f4e48e32517a52fd.tar.bz2 |
bpf, sockmap: Use stricter sk state checks in sk_lookup_assign
In order to fix an issue with sockets in TCP sockmap redirect cases we plan
to allow CLOSE state sockets to exist in the sockmap. However, the check in
bpf_sk_lookup_assign() currently only invalidates sockets in the
TCP_ESTABLISHED case relying on the checks on sockmap insert to ensure we
never SOCK_CLOSE state sockets in the map.
To prepare for this change we flip the logic in bpf_sk_lookup_assign() to
explicitly test for the accepted cases. Namely, a tcp socket in TCP_LISTEN
or a udp socket in TCP_CLOSE state. This also makes the code more resilent
to future changes.
Suggested-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/20211103204736.248403-2-john.fastabend@gmail.com
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions