]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: tcp: Do not limit cb_flags when creating child sk from listen sk
authorMartin KaFai Lau <kafai@fb.com>
Fri, 2 Oct 2020 01:34:48 +0000 (18:34 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 2 Oct 2020 18:34:48 +0000 (11:34 -0700)
commite8f54ce3f4409edfafc8813060ab4e88fdfa7b28
treef6490cacf4745d061f2e99ebc75b7e5566c02763
parent65b0faf3f56858f63809f423b095d8ae82ac2446
bpf: tcp: Do not limit cb_flags when creating child sk from listen sk

The commit ac15bd7b45ac ("bpf: tcp: Allow bpf prog to write and parse TCP header option")
unnecessarily introduced bpf_skops_init_child() which limited the child
sk from inheriting all bpf_sock_ops_cb_flags of the listen sk.  That
breaks existing user expectation.

This patch removes the bpf_skops_init_child() and just allows
sock_copy() to do its job to copy everything from listen sk to
the child sk.

Fixes: ac15bd7b45ac ("bpf: tcp: Allow bpf prog to write and parse TCP header option")
Reported-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20201002013448.2542025-1-kafai@fb.com
include/net/tcp.h
net/ipv4/tcp_minisocks.c