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]
Message-ID: <tkrat.b3c43c8b09b72285@s5r6.in-berlin.de>
Date:	Sun, 14 Sep 2008 10:35:05 +0200 (CEST)
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	linux1394-devel@...ts.sourceforge.net
cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] firewire: time out in fw_core_remove_card

This allows "modprobe -r firewire-ohci" (or card unbinding in general)
to proceed after 40 seconds even if there is a reference counting bug or
other shutdown bug in upper layers.

Signed-off-by: Stefan Richter <stefanr@...6.in-berlin.de>
---
 drivers/firewire/fw-card.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux/drivers/firewire/fw-card.c
===================================================================
--- linux.orig/drivers/firewire/fw-card.c
+++ linux/drivers/firewire/fw-card.c
@@ -16,6 +16,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#include <linux/bug.h>
 #include <linux/completion.h>
 #include <linux/crc-itu-t.h>
 #include <linux/delay.h>
@@ -508,7 +509,8 @@ fw_core_remove_card(struct fw_card *card
 
 	/* Wait for all users, especially device workqueue jobs, to finish. */
 	fw_card_put(card);
-	wait_for_completion(&card->done);
+	WARN(wait_for_completion_timeout(&card->done, 40 * HZ) == 0,
+	     KBUILD_MODNAME ": forced card shutdown with references held\n");
 
 	cancel_delayed_work_sync(&card->work);
 	WARN_ON(!list_empty(&card->transaction_list));

-- 
Stefan Richter
-=====-==--- =--= -===-
http://arcgraph.de/sr/

--
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