
From: "Zhu, Yi" <yi.zhu@intel.com>

In arch/i386/kernel/setup.c:
__early_param("acpi", early_acpi);

In drivers/acpi/osl.c:
__setup("acpi_os_name=", acpi_os_name_setup);

So if one passes kernel parameter in the bootloader as below,

"acpi=force acpi_os_name=my_override_name"

the "acpi_os_name=" parameter will take the setup func for "acpi",
because they begin with the same string "acpi".

Vanilla kernel doesn't have the problem now because most of the parameter
strings have a trailing '=', so "acpi_os_name" won't take the setup func for
"acpi=".  But a safer way is to checkup the parameter string when parsing it
as the patch did.


---

 25-akpm/init/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN init/main.c~kernel-parameter-parsing-fix init/main.c
--- 25/init/main.c~kernel-parameter-parsing-fix	2004-05-22 18:57:21.186616536 -0700
+++ 25-akpm/init/main.c	2004-05-22 18:57:21.189616080 -0700
@@ -151,11 +151,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;

_
