All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2]irq/core: Add a length limitation
@ 2009-11-25 14:04 Liuweni
  2009-11-25 14:08 ` Thomas Gleixner
  0 siblings, 1 reply; 3+ messages in thread
From: Liuweni @ 2009-11-25 14:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, xgr178, strongzgy, qingshenlwy, rusty, travis,
	adobriyan, tglx

 ---
In this version, I modify the code by Ingo's suggestion, 
and less code add. 
The code will check the irqaction->name's length 
and avoid Using too long name without any notice.
---
Signed-off-by: Liuwenyi<qingshenlwy@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Mike Travis <travis@sgi.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org

---
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c
index 0832145..b91dcb1 100644
--- a/kernel/irq/proc.c
+++ b/kernel/irq/proc.c
@@ -196,6 +196,8 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
 	char name [MAX_NAMELEN];
 	struct irq_desc *desc = irq_to_desc(irq);
 
+	WARN_ON(strlen(action->name) < MAX_NAMELEN);
+
 	if (!desc->dir || action->dir || !action->name ||
 					!name_unique(irq, action))
 		return;

 				
--------------
Best Regards,
Liuweni
2009-11-25


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

* Re: [PATCH V2]irq/core: Add a length limitation
  2009-11-25 14:04 [PATCH V2]irq/core: Add a length limitation Liuweni
@ 2009-11-25 14:08 ` Thomas Gleixner
  2009-11-25 14:16   ` Yong Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2009-11-25 14:08 UTC (permalink / raw)
  To: Liuweni
  Cc: linux-kernel, Ingo Molnar, xgr178, strongzgy, qingshenlwy, rusty,
	travis, adobriyan

On Wed, 25 Nov 2009, Liuweni wrote:

>  ---
> In this version, I modify the code by Ingo's suggestion, 
> and less code add. 
> The code will check the irqaction->name's length 
> and avoid Using too long name without any notice.
>
> --- a/kernel/irq/proc.c
> +++ b/kernel/irq/proc.c
> @@ -196,6 +196,8 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
>  	char name [MAX_NAMELEN];
>  	struct irq_desc *desc = irq_to_desc(irq);
>  
> +	WARN_ON(strlen(action->name) < MAX_NAMELEN);
> +

This is going to warn on every action->name which is actually used in
the kernel except for the ones which are too long.

Thanks,

	tglx



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

* Re: [PATCH V2]irq/core: Add a length limitation
  2009-11-25 14:08 ` Thomas Gleixner
@ 2009-11-25 14:16   ` Yong Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Yong Zhang @ 2009-11-25 14:16 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Liuweni, linux-kernel, Ingo Molnar, xgr178, strongzgy,
	qingshenlwy, rusty, travis, adobriyan

On Wed, Nov 25, 2009 at 10:08 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Wed, 25 Nov 2009, Liuweni wrote:
>
>>  ---
>> In this version, I modify the code by Ingo's suggestion,
>> and less code add.
>> The code will check the irqaction->name's length
>> and avoid Using too long name without any notice.
>>
>> --- a/kernel/irq/proc.c
>> +++ b/kernel/irq/proc.c
>> @@ -196,6 +196,8 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
>>       char name [MAX_NAMELEN];
>>       struct irq_desc *desc = irq_to_desc(irq);
>>
>> +     WARN_ON(strlen(action->name) < MAX_NAMELEN);
>> +
>
> This is going to warn on every action->name which is actually used in
> the kernel except for the ones which are too long.
>

Even we add WARN_ON(strlen(action->name) > MAX_NAMELEN), I think it doesn't
affect the runtime things, what it could tell is that there maybe two
different irqs
with the same name showed under /proc

Thanks,
Yong

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

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 14:04 [PATCH V2]irq/core: Add a length limitation Liuweni
2009-11-25 14:08 ` Thomas Gleixner
2009-11-25 14:16   ` Yong Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.