]> git.baikalelectronics.ru Git - kernel.git/commit
tcp/dccp: fix lockdep issue when SYN is backlogged
authorEric Dumazet <edumazet@google.com>
Mon, 1 Oct 2018 22:02:26 +0000 (15:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Oct 2018 22:42:13 +0000 (15:42 -0700)
commit31ab0e81adf5a0eb11afe3881fbc526e55bf7b9f
treefe345cf7a2ca53907e70b4522ba10b00d2e721bf
parentbd4663cc4a523fd3c0002857080ce52170e30120
tcp/dccp: fix lockdep issue when SYN is backlogged

In normal SYN processing, packets are handled without listener
lock and in RCU protected ingress path.

But syzkaller is known to be able to trick us and SYN
packets might be processed in process context, after being
queued into socket backlog.

In commit 5627fc3e36ca ("tcp/dccp: fix other lockdep splats
accessing ireq_opt") I made a very stupid fix, that happened
to work mostly because of the regular path being RCU protected.

Really the thing protecting ireq->ireq_opt is RCU read lock,
and the pseudo request refcnt is not relevant.

This patch extends what I did in commit 1d6c8bc08535 ("tcp/dccp:
block BH for SYN processing") by adding an extra rcu_read_{lock|unlock}
pair in the paths that might be taken when processing SYN from
socket backlog (thus possibly in process context)

Fixes: 5627fc3e36ca ("tcp/dccp: fix other lockdep splats accessing ireq_opt")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_sock.h
net/dccp/input.c
net/ipv4/tcp_input.c