Skip to contentSkip to conversation

two 2.5 modules bugs

DISCUSSION Mikael Pettersson 2 participants 2 messages Dec 29, 2002 – Dec 30, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 10 lines · Rusty Russell
Quoted 7 lines

1. With kernel 2.5.53 and module-init-tools-0.9.6, "modprobe tulip" fails and goes into an infinite CPU-consuming loop. The problem appears to be related to the dependency from tulip to crc32. If I manually modprobe crc32 before modprobe tulip, it works. If crc32 isn't loaded, modprobe tulip first loads crc32 and then loops.

module-init-tools-0.9.5 did not have this problem.

This should be fixed in 0.9.6: a double free caused all kinds of wierd behavior. Please tell me if this fixes it.

module-init-tools-0.9.7 fixed the problem.

Quoted 7 lines

Ew. I horribly misinterpreted "1-16s" to mean "a string 1-16 chars long". The obvious fix (untested) is:

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.53/kernel/module.c working-2.5.53-sparam/kernel/module.c

kernel/module.c extern int set_obsolete(const char *val, · line 611

Quoted 9 lines
kernel/module.c +2 -1
@@ -604,7 +604,8 @@ extern int set_obsolete(const char *val,
 		return param_array(kp->name, val, min, max, obsparm->addr,
 				   sizeof(long), param_set_long);
 	case 's':
-		return param_string(kp->name, val, min, max, obsparm->addr);
+		return param_array(kp->name, val, min, max, obsparm->addr,
+				   sizeof(char *), param_set_charp);
 	}
 	printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type);
 	return -EINVAL;

Tested. This patch makes the parport_pc module work again. Thanks.

/Mikael

#1 lore raw

In message <[email protected]> you write:

Quoted 3 lines
Quoted 2 lines

long". The obvious fix (untested) is:

Tested. This patch makes the parport_pc module work again. Thanks.

Linus, please apply. Mikael, thanks for the excellent bug report!

Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: Fix MODULE_PARM for arrays of s.
Author: Rusty Russell
Status: Tested on 2.5.53 (by Mikael Pettersson)

D: I interpreted "1-10s" to mean a string of 1-10 chars. It actually
D: means 1-10 comma-separated strings.

kernel/module.c +2 -15
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .748-linux-2.5-bk/kernel/module.c .748-linux-2.5-bk.updated/kernel/module.c
@@ -569,20 +569,6 @@ static int param_set_byte(const char *va
 	return 0;
 }
 
-static int param_string(const char *name, const char *val,
-			unsigned int min, unsigned int max,
-			char *dest)
-{
-	if (strlen(val) < min || strlen(val) > max) {
-		printk(KERN_ERR
-		       "Parameter %s length must be %u-%u characters\n",
-		       name, min, max);
-		return -EINVAL;
-	}
-	strcpy(dest, val);
-	return 0;
-}
-
 extern int set_obsolete(const char *val, struct kernel_param *kp)
 {
 	unsigned int min, max;
@@ -618,7 +604,8 @@ extern int set_obsolete(const char *val,
 		return param_array(kp->name, val, min, max, obsparm->addr,
 				   sizeof(long), param_set_long);
 	case 's':
-		return param_string(kp->name, val, min, max, obsparm->addr);
+		return param_array(kp->name, val, min, max, obsparm->addr,
+				   sizeof(char *), param_set_charp);
 	}
 	printk(KERN_ERR "Unknown obsolete parameter type %s\n", obsparm->type);
 	return -EINVAL;