Skip to content

Commit c9e9042

Browse files
Eric Dumazetdavem330
Eric Dumazet
authored andcommitted
ipv4: fix possible seqlock deadlock
ip4_datagram_connect() being called from process context, it should use IP_INC_STATS() instead of IP_INC_STATS_BH() otherwise we can deadlock on 32bit arches, or get corruptions of SNMP counters. Fixes: 584bdf8 ("[IPV4]: Fix "ipOutNoRoutes" counter error for TCP and UDP") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Dave Jones <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 84a035f commit c9e9042

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/datagram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
5757
if (IS_ERR(rt)) {
5858
err = PTR_ERR(rt);
5959
if (err == -ENETUNREACH)
60-
IP_INC_STATS_BH(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
60+
IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
6161
goto out;
6262
}
6363

0 commit comments

Comments
 (0)