Skip to contentSkip to conversation

firewire: don't panic on invalid AR request buffer

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firewire: don't panic on invalid AR request buffer

BUG() at this place is wrong. (Unless if the low level driver would already do higher-level input validation of incoming request headers.)

Invalid incoming requests or bugs in the controller which corrupt the AR-req buffer needlessly crashed the box because this is run in tasklet context.

---
 drivers/firewire/fw-transaction.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/firewire/fw-transaction.c +2 -1
Index: linux/drivers/firewire/fw-transaction.c
===================================================================
@@ -575,7 +575,8 @@ allocate_request(struct fw_packet *p)
 		break;
 
 	default:
-		BUG();
+		fw_error("ERROR - corrupt request received - %08x %08x %08x\n",
+			 p->header[0], p->header[1], p->header[2]);
 		return NULL;
 	}
 
Signature · 3 lines
Stefan Richter
-=====-==--- -=-= =====
http://arcgraph.de/sr/