Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e70ac171 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: tcp_probe: use spin_lock_bh()



tcp_rcv_established() can now run in process context.

We need to disable BH while acquiring tcp probe spinlock,
or risk a deadlock.

Fixes: 5413d1ba ("net: do not block BH while processing socket backlog")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarRicardo Nabinger Sanchez <rnsanchez@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a725eb15
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
	     (fwmark > 0 && skb->mark == fwmark)) &&
	    (full || tp->snd_cwnd != tcp_probe.lastcwnd)) {

		spin_lock(&tcp_probe.lock);
		spin_lock_bh(&tcp_probe.lock);
		/* If log fills, just silently drop */
		if (tcp_probe_avail() > 1) {
			struct tcp_log *p = tcp_probe.log + tcp_probe.head;
@@ -157,7 +157,7 @@ static void jtcp_rcv_established(struct sock *sk, struct sk_buff *skb,
			tcp_probe.head = (tcp_probe.head + 1) & (bufsize - 1);
		}
		tcp_probe.lastcwnd = tp->snd_cwnd;
		spin_unlock(&tcp_probe.lock);
		spin_unlock_bh(&tcp_probe.lock);

		wake_up(&tcp_probe.wait);
	}