]> git.baikalelectronics.ru Git - kernel.git/commit
tcp/dccp: block bh before arming time_wait timer
authorEric Dumazet <edumazet@google.com>
Fri, 1 Dec 2017 18:06:56 +0000 (10:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Dec 2017 20:07:43 +0000 (15:07 -0500)
commit176e60f5c2860191a7ef5457137beb8e74e3b46b
tree129ca3745010edb380f18e9420ea50ede3b8b1bc
parent19f455f628e5ecc595a124555e7e3e5b805da6e1
tcp/dccp: block bh before arming time_wait timer

Maciej Żenczykowski reported some panics in tcp_twsk_destructor()
that might be caused by the following bug.

timewait timer is pinned to the cpu, because we want to transition
timwewait refcount from 0 to 4 in one go, once everything has been
initialized.

At the time commit f1db0654a2ef ("tcp/dccp: fix timewait races in timer
handling") was merged, TCP was always running from BH habdler.

After commit e90f0e597ccc ("net: do not block BH while processing
socket backlog") we definitely can run tcp_time_wait() from process
context.

We need to block BH in the critical section so that the pinned timer
has still its purpose.

This bug is more likely to happen under stress and when very small RTO
are used in datacenter flows.

Fixes: e90f0e597ccc ("net: do not block BH while processing socket backlog")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Maciej Żenczykowski <maze@google.com>
Acked-by: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/minisocks.c
net/ipv4/tcp_minisocks.c