+ ieee1394-nodemgr-fix-rwsem-recursion.patch added to -mm tree

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

 



The patch titled

     ieee1394: nodemgr: fix rwsem recursion

has been added to the -mm tree.  Its filename is

     ieee1394-nodemgr-fix-rwsem-recursion.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ieee1394: nodemgr: fix rwsem recursion
From: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>

nodemgr_update_pdrv grabbed an rw semaphore (as reader) which was already
taken by its caller's caller, nodemgr_probe_ne (as reader too).  Reported by
Miles Lane, call path pointed out by Arjan van de Ven.

FIXME:
Shouldn't we rather use class->sem there, not class->subsys.rwsem?

Signed-off-by: Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/ieee1394/nodemgr.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -puN drivers/ieee1394/nodemgr.c~ieee1394-nodemgr-fix-rwsem-recursion drivers/ieee1394/nodemgr.c
--- a/drivers/ieee1394/nodemgr.c~ieee1394-nodemgr-fix-rwsem-recursion
+++ a/drivers/ieee1394/nodemgr.c
@@ -1316,6 +1316,7 @@ static void nodemgr_node_scan(struct hos
 }
 
 
+/* Caller needs to hold nodemgr_ud_class.subsys.rwsem as reader. */
 static void nodemgr_suspend_ne(struct node_entry *ne)
 {
 	struct class_device *cdev;
@@ -1368,15 +1369,14 @@ static void nodemgr_resume_ne(struct nod
 }
 
 
+/* Caller needs to hold nodemgr_ud_class.subsys.rwsem as reader. */
 static void nodemgr_update_pdrv(struct node_entry *ne)
 {
 	struct unit_directory *ud;
 	struct hpsb_protocol_driver *pdrv;
-	struct class *class = &nodemgr_ud_class;
 	struct class_device *cdev;
 
-	down_read(&class->subsys.rwsem);
-	list_for_each_entry(cdev, &class->children, node) {
+	list_for_each_entry(cdev, &nodemgr_ud_class.children, node) {
 		ud = container_of(cdev, struct unit_directory, class_dev);
 		if (ud->ne != ne || !ud->device.driver)
 			continue;
@@ -1389,7 +1389,6 @@ static void nodemgr_update_pdrv(struct n
 			up_write(&ud->device.bus->subsys.rwsem);
 		}
 	}
-	up_read(&class->subsys.rwsem);
 }
 
 
@@ -1420,6 +1419,8 @@ static void nodemgr_irm_write_bc(struct 
 }
 
 
+/* Caller needs to hold nodemgr_ud_class.subsys.rwsem as reader because the
+ * calls to nodemgr_update_pdrv() and nodemgr_suspend_ne() here require it. */
 static void nodemgr_probe_ne(struct host_info *hi, struct node_entry *ne, int generation)
 {
 	struct device *dev;
_

Patches currently in -mm which might be from stefanr@xxxxxxxxxxxxxxxxx are

git-ieee1394.patch
ieee1394-fix-kerneldoc-of-hpsb_alloc_host.patch
ieee1394-shrink-tlabel-pools-remove-tpool-semaphores.patch
ieee1394-remove-include-asm-semaphoreh.patch
ieee1394-sbp2-safer-last_orb-and.patch
ieee1394-sbp2-discard-return-value-of.patch
ieee1394-sbp2-optimize-dma-direction-of.patch
ieee1394-sbp2-safer-initialization-of.patch
ieee1394-sbp2-more-checks-of-status.patch
ieee1394-sbp2-convert.patch
ieee1394-safer-definition-of-empty-macros.patch
ieee1394-sbp2-workaround-for-write-protect-bit-of.patch
ieee1394-sbp2-enable-auto-spin-up-for-all-sbp-2-devices.patch
config_pm=n-slim-drivers-ieee1394-ohci1394c.patch
the-scheduled-removal-of-drivers-ieee1394-sbp2cforce_inquiry_hack.patch
ieee1394-sbp2-handle-sbp2util_node_write_no_wait-failed.patch
ieee1394-sbp2-safer-agent-reset-in-error-handlers.patch
ieee1394-sbp2-recheck-node-generation-in-sbp2_update.patch
ieee1394-sbp2-better-handling-of-transport-errors.patch
ieee1394-sbp2-update-includes.patch
ieee1394-sbp2-prevent-rare-deadlock-in-shutdown.patch
initialize-ieee1394-early-when-built-in.patch
ieee1394-sbp2-more-help-in-kconfig.patch
ieee1394-nodemgr-fix-rwsem-recursion.patch
ieee1394-nodemgr-grab-classsubsysrwsem-in.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