From: "Zhu, Yi" <yi.zhu@intel.com>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] Kernel parameter parsing fix
Date: Fri, 21 May 2004 13:53:10 +0800 [thread overview]
Message-ID: <3ACA40606221794F80A5670F0AF15F842DB1D2@PDSMSX403.ccr.corp.intel.com> (raw)
Hi,
Must all the kernel parameters have trailing '=' at the end of the param
string?
If not, I think below patch is useful to avoid potential problems.
Thanks,
-yi
--- linux-2.6.6.orig/init/main.c 2004-05-14 13:38:31.000000000
+0800
+++ linux-2.6.6/init/main.c 2004-05-15 00:25:41.339261792 +0800
@@ -149,11 +149,15 @@ static int __init obsolete_checksetup(ch
{
struct obs_kernel_param *p;
extern struct obs_kernel_param __setup_start, __setup_end;
+ char *ptr;
+ int len = strlen(line);
+ if ((ptr = strchr(line, '=')))
+ len = ptr - line;
p = &__setup_start;
do {
int n = strlen(p->str);
- if (!strncmp(line, p->str, n)) {
+ if (len <= n && !strncmp(line, p->str, n)) {
if (!p->setup_func) {
printk(KERN_WARNING "Parameter %s is
obsolete, ignored\n", p->str);
return 1;
next reply other threads:[~2004-05-21 23:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-21 5:53 Zhu, Yi [this message]
2004-05-21 10:07 Zhu, Yi
2004-05-21 10:13 ` Andrew Morton
[not found] <3ACA40606221794F80A5670F0AF15F8403FD31C2@PDSMSX403.ccr.corp.intel.com>
2004-05-22 14:43 ` Zhu, Yi
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=3ACA40606221794F80A5670F0AF15F842DB1D2@PDSMSX403.ccr.corp.intel.com \
--to=yi.zhu@intel.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®