Skip to content

Commit

Permalink
tcp: fix inet_twsk_deschedule()
Browse files Browse the repository at this point in the history
Eric W. Biederman reported a lockdep splat in inet_twsk_deschedule()

This is caused by inet_twsk_purge(), run from process context,
and commit 575f4cd (net: Use rcu lookups in inet_twsk_purge.)
removed the BH disabling that was necessary.

Add the BH disabling but fine grained, right before calling
inet_twsk_deschedule(), instead of whole function.

With help from Linus Torvalds and Eric W. Biederman

Reported-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Daniel Lezcano <daniel.lezcano@free.fr>
CC: Pavel Emelyanov <xemul@openvz.org>
CC: Arnaldo Carvalho de Melo <acme@redhat.com>
CC: stable <stable@kernel.org> (# 2.6.33+)
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Feb 20, 2011
1 parent ece639c commit 91035f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv4/inet_timewait_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,9 @@ void inet_twsk_purge(struct inet_hashinfo *hashinfo,
}

rcu_read_unlock();
local_bh_disable();
inet_twsk_deschedule(tw, twdr);
local_bh_enable();
inet_twsk_put(tw);
goto restart_rcu;
}
Expand Down

0 comments on commit 91035f0

Please sign in to comment.