[PATCH]irq/core:Add a length limitation

From: Liuweni
Date: Tue Nov 24 2009 - 08:43:44 EST


In the register_handler_proc(), the max length of irqaction->name is MAX_NAMELEN.
And this function will call name_unique() to compare name with other irqs'.
There is no any code for limitation the length.
I add a warning in the function to notice that the irqaction->name is too long.

Signed-off-by: Liuwenyi <qingshenlwy@xxxxxxxxx>
---
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 0832145..9ab6e04 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -196,6 +196,9 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
char name [MAX_NAMELEN];
struct irq_desc *desc = irq_to_desc(irq);

+ if(strlen(action->name) >= MAX_NAMELEN)
+ WARN_ON(1);
+
if (!desc->dir || action->dir || !action->name ||
!name_unique(irq, action))
return;
---

Best Regards,
Liuweni
2009-11-24

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/