Skip to contentSkip to conversation

kernel oops with badly formatted module option

DISCUSSION Larry Finger 3 participants 4 messages Apr 8, 2007 – Apr 9, 2007

lore
Share & tools
lore
#0 lore raw

With the following line in /etc/modprobe.conf.local:

options bcm43xx fwpostfix = ".fw3" locale=8

the kernel oops below is generated. I realize that the line should have no whitespace around the "=", but I do not feel that an oops is the best way to report the syntax error. Could there be a more gentle failure?

This is an x86_64 system running 2.6.16-rc5 from Linville's wireless-2.6 tree. The "dirty" refers to patches for the bcm43xx driver that are under test.

Larry

kernel: Unable to handle kernel NULL pointer dereference at 0000000000000000 RIP:
kernel: [<ffffffff80242b76>] param_set_copystring+0x15/0x4b
kernel: PGD 3ce82067 PUD 34b0c067 PMD 0
kernel: Oops: 0000 [1] SMP
kernel: CPU 0
kernel: Modules linked in: af_packet snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device cpufreq_conservative cpuf
req_ondemand cpufreq_userspace cpufreq_powersave powernow_k8 freq_table button battery ac loop snd_hda_intel snd_hda_codec snd_pcm snd_t
imer snd ohci1394 soundcore snd_page_alloc ieee1394 ide_cd cdrom ehci_hcd ohci_hcd sdhci mmc_core usbcore forcedeth i2c_nforce2 firmware
_class ieee80211softmac ieee80211 ieee80211_crypt ext3 mbcache jbd sg edd fan sata_nv libata amd74xx thermal processor sd_mod scsi_mod i
de_disk ide_core

kernel: Pid: 4325, comm: modprobe Not tainted 2.6.21-rc5-L2.6-gae6ff7a1-dirty #5
kernel: RIP: 0010:[<ffffffff80242b76>]  [<ffffffff80242b76>] param_set_copystring+0x15/0x4b
kernel: RSP: 0018:ffff81003dee3dd8  EFLAGS: 00010286
kernel: RAX: 0000000000000000 RBX: ffff810053736c7a RCX: ffffffffffffffff
kernel: RDX: 0000000000000040 RSI: ffffffff882fee68 RDI: 0000000000000000
kernel: RBP: ffff81003dee3dd8 R08: ffffffff88307ea0 R09: 0000000000000000
kernel: R10: 0000000000000006 R11: ffffffff88307e88 R12: 0000000000000028
kernel: R13: ffff810053736c70 R14: 0000000000000000 R15: ffffffff88308098
kernel: FS:  00002ae7eb6246f0(0000) GS:ffffffff80505000(0000) knlGS:00000000f70686d0
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
kernel: CR2: 0000000000000000 CR3: 0000000036ff8000 CR4: 00000000000006e0
kernel: Process modprobe (pid: 4325, threadinfo ffff81003dee2000, task ffff810035d31140)
kernel: Stack:  ffff81003dee3e38 ffffffff802430ff ffffffff88308080 0000000000000000
kernel:  00000007003b74d8 ffffffff882fed78 0000000000000202 ffffc200003b77d8
kernel:  0000000000000028 ffffffff88308080 ffffffff88304c78 ffffc200003b7498
kernel: Call Trace:
kernel:  [<ffffffff802430ff>] parse_args+0x139/0x216
kernel:  [<ffffffff80253a2f>] sys_init_module+0x1376/0x1744
kernel:  [<ffffffff802446f3>] autoremove_wake_function+0x0/0x38
kernel:  [<ffffffff80350d5a>] device_remove_file+0x0/0x33
kernel:  [<ffffffff803d44bc>] trace_hardirqs_on_thunk+0x35/0x37
kernel:  [<ffffffff80209fae>] system_call+0x7e/0x83

kernel:
kernel: Code: f2 ae 89 d0 48 f7 d1 48 39 c1 76 1a 48 8b 36 ff ca 48 c7 c7
kernel: RIP [<ffffffff80242b76>] param_set_copystring+0x15/0x4b
kernel: RSP <ffff81003dee3dd8>

#1 lore raw
Quoted 6 lines · On Sat, 07 Apr 2007 19:21:01 -0500 Larry Finger wrote:

With the following line in /etc/modprobe.conf.local:

options bcm43xx fwpostfix = ".fw3" locale=8

the kernel oops below is generated. I realize that the line should have no whitespace around the "=", but I do not feel that an oops is the best way to report the syntax error. Could there be a more gentle failure?

From: Randy Dunlap <[email protected]>

Catch malformed kernel parameter usage of "param = value". Spaces are not supported, but don't cause a kernel fault on such usage, just report an error.

---
 kernel/params.c |    4 ++++
 1 file changed, 4 insertions(+)
kernel/params.c +4 -0
@@ -356,6 +356,10 @@ int param_set_copystring(const char *val
 {
 	struct kparam_string *kps = kp->arg;
 
+	if (!val) {
+		printk(KERN_ERR "%s: missing param set value\n", kp->name);
+		return -EINVAL;
+	}
 	if (strlen(val)+1 > kps->maxlen) {
 		printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
 		       kp->name, kps->maxlen-1);
#2 lore raw
Quoted 9 lines · Randy Dunlap
Quoted 5 lines · On Sat, 07 Apr 2007 19:21:01 -0500 Larry Finger wrote:

With the following line in /etc/modprobe.conf.local:

options bcm43xx fwpostfix = ".fw3" locale=8

the kernel oops below is generated. I realize that the line should have no whitespace around the "=", but I do not feel that an oops is the best way to report the syntax error. Could there be a more gentle failure?

Quoted 7 lines

From: Randy Dunlap <[email protected]>

Catch malformed kernel parameter usage of "param = value". Spaces are not supported, but don't cause a kernel fault on such usage, just report an error.

It works here. ACKed by: Larry Finger <[email protected]>

Quoted 18 lines
---
 kernel/params.c |    4 ++++
 1 file changed, 4 insertions(+)
kernel/params.c +4 -0
@@ -356,6 +356,10 @@ int param_set_copystring(const char *val
 {
 	struct kparam_string *kps = kp->arg;
 
+	if (!val) {
+		printk(KERN_ERR "%s: missing param set value\n", kp->name);
+		return -EINVAL;
+	}
 	if (strlen(val)+1 > kps->maxlen) {
 		printk(KERN_ERR "%s: string doesn't fit in %u chars.\n",
 		       kp->name, kps->maxlen-1);
Acked-by
#3 lore raw
In reply to Randy Dunlap
Quoted 10 lines · Randy Dunlap
Quoted 6 lines · On Sat, 07 Apr 2007 19:21:01 -0500 Larry Finger wrote:

With the following line in /etc/modprobe.conf.local:

options bcm43xx fwpostfix = ".fw3" locale=8

the kernel oops below is generated. I realize that the line should have no whitespace around the "=", but I do not feel that an oops is the best way to report the syntax error. Could there be a more gentle failure?

Quoted 7 lines

From: Randy Dunlap <[email protected]>

Catch malformed kernel parameter usage of "param = value". Spaces are not supported, but don't cause a kernel fault on such usage, just report an error.

Thanks Randy,

I even read your patch before I wrote my own, for a change!