lkml.org 
[lkml]   [2004]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] Kernel parameter parsing fix
Date
From

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;
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.025 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site