Staging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sat, 2 Jan 2010 10:30:41 +0000 (11:30 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:35 +0000 (16:42 -0800)
commitcec4a69cfc2bc780b4107193cb9bd621b67ab2b6
tree8d769d01d2f95d19e4e59fff9b95c242aa468e36
parent5ea84fa369baa3d36fa8a78e9af3dc71bbcbca51
Staging: batman-adv: Use forw_bcast_list_lock always with disabled interrupts

forw_bcast_list_lock is spin_locked in both process and softirq context.
SoftIRQ calls the spinlock with disabled IRQ and normal process context
with enabled IRQs.

When process context is inside an spin_locked area protected by
forw_bcast_list_lock and gets interrupted by an IRQ, it could happen
that something tries to lock forw_bcast_list_lock again in SoftIRQ
context. It cannot proceed further since the lock is already taken
somewhere else, but no reschedule will happen inside the SoftIRQ
context. This leads to an complete kernel hang without any chance of
resurrection.

All functions called in process context must disable IRQs when they try
to get get that lock to to prevent any reschedule due to IRQs.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Acked-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/send.c