Skip to contentSkip to conversation

firewire: fw-ohci: use of uninitialized data in AR handler

PATCH New Stefan Richter 1 participant 1 message May 31, 2008 Firewire

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firewire: fw-ohci: use of uninitialized data in AR handler

header_length and payload_length are filled with random data if an unknown tcode was read from the AR buffer (i.e. if the AR buffer contained invalid data).

We still need a better strategy to recover from this, but at least handle_ar_packet now doesn't return out of bound buffer addresses anymore.

---
 drivers/firewire/fw-ohci.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/firewire/fw-ohci.c +5 -0
Index: linux/drivers/firewire/fw-ohci.c
===================================================================
@@ -548,6 +548,11 @@ static __le32 *handle_ar_packet(struct a
 		p.header_length = 12;
 		p.payload_length = 0;
 		break;
+
+	default:
+		/* FIXME: Stop context, discard everything, and restart? */
+		p.header_length = 0;
+		p.payload_length = 0;
 	}
 
 	p.payload = (void *) buffer + p.header_length;
Signature · 3 lines
Stefan Richter
-=====-==--- -=-= =====
http://arcgraph.de/sr/