summaryrefslogtreecommitdiff
path: root/net/ipv4/inet_connection_sock.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-08-16 22:49:07 +0300
committerAlexei Starovoitov <ast@kernel.org>2018-08-17 00:58:08 +0300
commit90545cdc3f2b2ea700e24335610cd181e73756da (patch)
treecf5bf1385744bb864f8f7844c2b98c88b9e695f4 /net/ipv4/inet_connection_sock.c
parent037b0b86ecf5646f8eae777d8b52ff8b401692ec (diff)
downloadlinux-90545cdc3f2b2ea700e24335610cd181e73756da.tar.xz
tcp, ulp: fix leftover icsk_ulp_ops preventing sock from reattach
I found that in BPF sockmap programs once we either delete a socket from the map or we updated a map slot and the old socket was purged from the map that these socket can never get reattached into a map even though their related psock has been dropped entirely at that point. Reason is that tcp_cleanup_ulp() leaves the old icsk->icsk_ulp_ops intact, so that on the next tcp_set_ulp_id() the kernel returns an -EEXIST thinking there is still some active ULP attached. BPF sockmap is the only one that has this issue as the other user, kTLS, only calls tcp_cleanup_ulp() from tcp_v4_destroy_sock() whereas sockmap semantics allow dropping the socket from the map with all related psock state being cleaned up. Fixes: 1aa12bdf1bfb ("bpf: sockmap, add sock close() hook to remove socks") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.fastabend@gmail.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
0 files changed, 0 insertions, 0 deletions