public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]irq/core:Add a length limitation
@ 2009-11-24 13:47 Liuweni
  2009-11-24 14:45 ` Ingo Molnar
  2009-11-25 13:20 ` Liuweni
  0 siblings, 2 replies; 3+ messages in thread
From: Liuweni @ 2009-11-24 13:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: xgr178, Jiri Kosina, qingshenlwy

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@gmail.com>
---
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


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

end of thread, other threads:[~2009-11-25 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24 13:47 [PATCH]irq/core:Add a length limitation Liuweni
2009-11-24 14:45 ` Ingo Molnar
2009-11-25 13:20 ` Liuweni

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