diff options
author | Martin KaFai Lau <kafai@fb.com> | 2020-10-02 03:34:48 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-10-02 20:34:48 +0200 |
commit | 82f45c6c4a70622cc0585e3f4372e192a6491d26 (patch) | |
tree | f6490cacf4745d061f2e99ebc75b7e5566c02763 /net/ipv4 | |
parent | selftests/bpf: Properly initialize linfo in sockmap_basic (diff) | |
download | linux-82f45c6c4a70622cc0585e3f4372e192a6491d26.tar.xz linux-82f45c6c4a70622cc0585e3f4372e192a6491d26.zip |
bpf: tcp: Do not limit cb_flags when creating child sk from listen sk
The commit 0813a841566f ("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: 0813a841566f ("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
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 56c306e3cd2f..495dda2449fe 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -548,7 +548,6 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, newtp->fastopen_req = NULL; RCU_INIT_POINTER(newtp->fastopen_rsk, NULL); - bpf_skops_init_child(sk, newsk); tcp_bpf_clone(sk, newsk); __TCP_INC_STATS(sock_net(sk), TCP_MIB_PASSIVEOPENS); |