]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:53:27 +0000 (19:53 -0600)
commit57fc224ca0f14d4b63b7c5c8267c53ce179a05f9
tree1a286b4b564c4f87344992a1c07becf704e6367b
parent850f3561f64809a6d3795391f6e4b3ca65d9bd66
tcp/dccp: fix lockdep issue when SYN is backlogged

BugLink: https://bugs.launchpad.net/bugs/1836426
[ Upstream commit 1ad98e9d1bdf4724c0a8532fabd84bf3c457c2bc ]

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 06f877d613be ("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 449809a66c1d ("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: 06f877d613be ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
include/net/inet_sock.h
net/dccp/input.c
net/ipv4/tcp_input.c