public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firewire: fix panic in handle_at_packet
@ 2008-03-15 23:56 Stefan Richter
  2008-03-17  3:32 ` Jarod Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Richter @ 2008-03-15 23:56 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel, Johannes Berg, Jarod Wilson

This fixes a use-after-free bug in the handling of split transactions.
The AT DMA handler of the request was occasionally executed after the
AR DMA handler of the response.  The AT DMA handler then accessed an
already freed packet.

Reported by Johannes Berg <johannes@sipsolutions.net>.
http://bugzilla.kernel.org/show_bug.cgi?id=9617

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

Index: linux/drivers/firewire/fw-transaction.c
===================================================================
--- linux.orig/drivers/firewire/fw-transaction.c
+++ linux/drivers/firewire/fw-transaction.c
@@ -737,6 +737,12 @@ fw_core_handle_response(struct fw_card *
 		break;
 	}
 
+	/*
+	 * The response handler may be executed while the request handler
+	 * is still pending.  Cancel the request handler.
+	 */
+	card->driver->cancel_packet(card, &t->packet);
+
 	t->callback(card, rcode, data, data_length, t->callback_data);
 }
 EXPORT_SYMBOL(fw_core_handle_response);

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-20  0:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-15 23:56 [PATCH] firewire: fix panic in handle_at_packet Stefan Richter
2008-03-17  3:32 ` Jarod Wilson
2008-03-19 23:24   ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox