Linux/linux d624d27net/ipv4 tcp_ipv4.c, net/ipv6 tcp_ipv6.c

tcp: fix possible deadlock in TCP stack vs BPF filter

Filtering the ACK packet was not put at the right place.

At this place, we already allocated a child and put it
into accept queue.

We absolutely need to call tcp_child_process() to release
its spinlock, or we will deadlock at accept() or close() time.

Found by syzkaller team (Thanks a lot !)

Fixes: 8fac365f63c8 ("tcp: Add a tcp_filter hook before handle ack packet")
Signed-off-by: Eric Dumazet <edumazet at google.com>
Reported-by: Dmitry Vyukov <dvyukov at google.com>
Cc: Chenbo Feng <fengc at google.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
DeltaFile
+2-2net/ipv4/tcp_ipv4.c
+2-2net/ipv6/tcp_ipv6.c
+4-42 files

UnifiedSplitRaw