]> git.baikalelectronics.ru Git - kernel.git/commit
dccp: avoid deadlock in dccp_v4_ctl_send_reset
authorEric Dumazet <edumazet@google.com>
Fri, 8 Jul 2016 09:03:57 +0000 (11:03 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Jul 2016 22:14:17 +0000 (18:14 -0400)
commitd7d2ba11b6a93a80b673ab54cef446342df70d18
tree38d19b84c9d1d2b632f0c08a321dd9fb44c7e5f3
parenta4a0e94c8be9743a1bfa17a2212661595830c263
dccp: avoid deadlock in dccp_v4_ctl_send_reset

In the prep work I did before enabling BH while handling socket backlog,
I missed two points in DCCP :

1) dccp_v4_ctl_send_reset() uses bh_lock_sock(), assuming BH were
blocked. It is not anymore always true.

2) dccp_v4_route_skb() was using __IP_INC_STATS() instead of
  IP_INC_STATS()

A similar fix was done for TCP, in commit ac5147408ddc
("ipv4: tcp: ip_send_unicast_reply() is not BH safe")

Fixes: fd3a3031d5d0 ("dccp: do not assume DCCP code is non preemptible")
Fixes: 54a874cf32f4 ("net: do not block BH while processing socket backlog")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dccp/ipv4.c