tcp_init_sock() is not called for children (at accept() time)
Only for freshly allocated sockets, inet[6]_create() call tcp_init_sock() via
if (sk->sk_prot->init) {
err = sk->sk_prot->init(sk);
if (err) { sk_common_release(sk);
goto out;
}
}
But passive connections do not have such a call.
tcp_create_openreq_child() is clearing/resetting
all fields that must be cleared/reset
after the cloning from parent (listener) happened.
It is not clear why at accept() time we find the listener sk_pagepool
locked because this stuff matters only for established flows.
We must not assume user space would not do strange things.
Therefore the fix will be either in inet_csk_clone_lock()
if we want to extend sk_pagepool to other protocols,
or tcp_create_openreq_child() since only TCP calls xa_destroy() so far.
Fixes: 987df26c30c6 ("tcp: implement RX path for devmem sockets")
Change-Id: I3cc3770af224f790154ee56094ddfc4f7797428b
Signed-off-by: Eric Dumazet <email address hidden>
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/64590
Reviewed-by: Mina Almasry <email address hidden>
Tested-by: Mina Almasry <email address hidden>
(cherry picked from commit f8319337b01cf8edabafbdddd6b1d538a8c246da https://cos.googlesource.com/third_party/kernel/+log/refs/heads/tcpd/R105)
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Manuel Diewald <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>
/proc/sys/net/core/optmem_max is now per netns, change two tests
that were saving/changing/restoring its value on the parent netns.
Change-Id: Idacd74a41133cbb849cca0d608a02dcad97da92b
Signed-off-by: Eric Dumazet <email address hidden>
Reviewed-by: Willem de Bruijn <email address hidden>
Signed-off-by: David S. Miller <email address hidden>
(cherry picked from commit 18872ba8cd2406ffa835f9f6276e47ed86fbb5d6)
Reviewed-on: https://cos-review.googlesource.com/c/third_party/kernel/+/62584
Tested-by: Mina Almasry <email address hidden>
(cherry picked from commit 128a8bec61acef84adf608afa8590c0a81692796 https://cos.googlesource.com/third_party/kernel/+log/refs/heads/tcpd/R105)
Signed-off-by: John Cabaj <email address hidden>
Acked-by: Manuel Diewald <email address hidden>
Acked-by: Joseph Salisbury <email address hidden>
Signed-off-by: John Cabaj <email address hidden>