lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Dec 2007 22:59:20 -0800
From:	Srinivas Kommu <kommu@...mail.com>
To:	linux-kernel@...r.kernel.org
CC:	Srinivas Kommu <kommu@...mail.com>
Subject: driver spin lock and files_lock deadlock question

I have a driver that needs to be SMP-safe. It also has some code hooking 
into the net_rx_action softirq. So it takes a spinlock and disables the 
local bottom-half around its critical sections: 
spin_lock_bh(&driver_lock). Now, I'm facing a deadlock under a 
particular sequence involving the files_lock:

1. CPU 0 takes driver_lock and then calls remove_proc_entry() which is 
hanging at spin_lock(&files_lock).

2. CPU 1 was in fput() which took files_lock; the softirq comes in at 
this point and attempts to take driver_lock and hangs forever.

It seems this kind of a deadlock can happen with any kernel lock, not 
just files_lock. What's the driver's mistake here? Is it wrong to call 
remove_proc_entry() while holding another lock? What is the right thing 
to do?

This is with the 2.4 kernel, BTW.


thanks
srini
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ