- lock-validator-netlinkc-netlink_table_grab-fix.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     lock validator: netlink.c netlink_table_grab fix

has been removed from the -mm tree.  Its filename is

     lock-validator-netlinkc-netlink_table_grab-fix.patch

This patch was probably dropped from -mm because
it has now been merged into a subsystem tree or
into Linus's tree, or because it was folded into
its parent patch in the -mm tree.

------------------------------------------------------
Subject: lock validator: netlink.c netlink_table_grab fix
From: Frederik Deweerdt <deweerdt@xxxxxxx>


ipw2200 calls netlink_broadcast from irq context.

this isn't allow to be called from IRQ context, because it takes
nl_table_lock for read, but that is taken as
        write_lock_bh(&nl_table_lock);
in 
	static void netlink_table_grab(void)
so without disabling interrupts; which would thus deadlock if this
read_lock-from-irq would hit.

>  <c02fb6a4> wireless_send_event+0x304/0x340
>  <e1cf8e11> ipw_rx+0x1371/0x1bb0 [ipw2200] 
>  <e1cfe6ac> ipw_irq_tasklet+0x13c/0x500 [ipw2200]
>  <c0121ea0> tasklet_action+0x40/0x90  

but it's more complex than that, since we ARE in BH context.
The complexity comes from us holding &priv->lock, which is 
used in hard irq context.

so the deadlock is like this:


cpu 0: user context					cpu1: softirq context
   netlink_table_grab takes nl_table_lock as		take priv->lock	in ipw_irq_tasklet
   write_lock_bh, but leaves irqs enabled


   hardirq comes in and the isr tries to take           in ipw_rx, call wireless_send_event which
   priv->lock but has to wait on cpu 1                  tries to take nl_table_lock for read
                                                        but has to wait for cpu0

and... kaboom kabang deadlock :)

(akpm: it's not clear that this is the right fix?)

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Cc: "Zhu, Yi" <yi.zhu@xxxxxxxxx>
Cc: Jeff Garzik <jeff@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 net/netlink/af_netlink.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN net/netlink/af_netlink.c~lock-validator-netlinkc-netlink_table_grab-fix net/netlink/af_netlink.c
--- 25/net/netlink/af_netlink.c~lock-validator-netlinkc-netlink_table_grab-fix	Fri Jun  2 15:10:18 2006
+++ 25-akpm/net/netlink/af_netlink.c	Fri Jun  2 15:10:18 2006
@@ -157,7 +157,7 @@ static void netlink_sock_destruct(struct
 
 static void netlink_table_grab(void)
 {
-	write_lock_bh(&nl_table_lock);
+	write_lock_irq(&nl_table_lock);
 
 	if (atomic_read(&nl_table_users)) {
 		DECLARE_WAITQUEUE(wait, current);
@@ -167,9 +167,9 @@ static void netlink_table_grab(void)
 			set_current_state(TASK_UNINTERRUPTIBLE);
 			if (atomic_read(&nl_table_users) == 0)
 				break;
-			write_unlock_bh(&nl_table_lock);
+			write_unlock_irq(&nl_table_lock);
 			schedule();
-			write_lock_bh(&nl_table_lock);
+			write_lock_irq(&nl_table_lock);
 		}
 
 		__set_current_state(TASK_RUNNING);
@@ -179,7 +179,7 @@ static void netlink_table_grab(void)
 
 static __inline__ void netlink_table_ungrab(void)
 {
-	write_unlock_bh(&nl_table_lock);
+	write_unlock_irq(&nl_table_lock);
 	wake_up(&nl_table_wait);
 }
 
_

Patches currently in -mm which might be from deweerdt@xxxxxxx are

lock-validator-netlinkc-netlink_table_grab-fix.patch
acpi-identify-which-device-is-not-power-manageable-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux