From: "Liuweni" <qingshenlwy@gmail.com>
To: "Ingo Molnar" <mingo@elte.hu>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
"xgr178" <xgr178@163.com>, "Jiri Kosina" <jkosina@suse.cz>
Subject: Re: [PATCH]irq/core:Add a length limitation
Date: Wed, 25 Nov 2009 21:20:06 +0800 [thread overview]
Message-ID: <200911252119598758808@gmail.com> (raw)
In-Reply-To: 200911242147508598860@gmail.com
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 1849 bytes --]
Hi Ingo,
I don't know whether this situation happened in the past.
I upload this code for code Integrity. The WARN_ON is set on OFF,
While anybody use it, and set it ON.
Thank you for you suggestion.
I modify the code and use scripts/checkpatch.pl and scripts/get_maintainer.pl
on the patch. Please have a check later.
--------------
Best Regards,
Liuweni
2009-11-25
·¢¼þÈË£º Ingo Molnar
·¢ËÍʱ¼ä£º 2009-11-24 22:45:38
ÊÕ¼þÈË£º Liuweni; Thomas Gleixner
³ËÍ£º linux-kernel; xgr178; Jiri Kosina; qingshenlwy
Ö÷Ì⣺ Re: [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
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
prev parent reply other threads:[~2009-11-25 13:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200911252119598758808@gmail.com \
--to=qingshenlwy@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=xgr178@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox