lkml.org 
[lkml]   [2009]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH]irq/core:Add a length limitation

* Liuweni <qingshenlwy@gmail.com> wrote:

> 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);
> +

Has this situation happened in the past that requires this check to be
added? The current limit of 128 chars is quite generous. Also, the check
is buggy, it's off by 1.

( Also, please use scripts/checkpatch.pl on patches and please use
'scripts/get_maintainer.pl -f kernel/irq/proc.c' when constructing Cc:
lines. )

Thanks,

Ingo


\
 
 \ /
  Last update: 2009-11-24 15:47    [W:0.047 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site