Skip to contentSkip to conversation

Kernel Oops-jprobe

DISCUSSION Prasanna S Panchamukhi 2 participants 4 messages Mar 17, 2006

lore
Share & tools
lore
#0 lore raw
Quoted 5 lines

Greetings,

The following oops occurs when probing the sys_open function. Following is the oops and a module with which the error can be replicated.

I tried to recreate this problem on 4-way i386 box, but could not recreate it. Could you please send me your config file?

Thanks
Prasanna

Quoted 24 lines
[17192145.756000] kobject sysensor: registering. parent: <NULL>, set:
module
[17192145.756000] kobject_hotplug
[17192145.756000] fill_kobj_path: path = '/module/sysensor'
[17192145.756000] kobject_hotplug: /sbin/udevsend module seq=1024
HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin ACTION=add
DEVPATH=/module/sysensor SUBSYSTEM=module[17192146.124000] Unable to
handle kernel paging request at virtual address 080c9566
[17192146.124000]  printing eip:
[17192146.124000] c01c61ae
[17192146.124000] *pde = 0e124067
[17192146.124000] *pte = 00000000
[17192146.124000] Oops: 0000 [#1]
[17192146.124000] PREEMPT
[17192146.124000] Modules linked in: sysensor ppp_deflate zlib_deflate

bsd_comp ppp_async crc_ccitt ppp_generic slhc ipv6 acpi_cpufreq speedstep_lib cpufreq_powersave cpufreq_userspace serial_cs cpufreq_ondemand i915 pcmcia drm video battery container fan button thermal processor ac ohci1394 yenta_socket rsrc_nonstatic pcmcia_core ipw2200 ieee80211 ieee80211_crypt firmware_class b44 mii snd_intel8x0 snd_ac97_codec snd_ac97_bus snd_pcm_oss snd_mixer_oss snd_pcm shpchp pci_hotplug ehci_hcd uhci_hcd usbcore intel_agp agpgart rtc joydev md_mod dm_mod sr_mod sbp2 scsi_mod ieee1394 psmouse mousedev parport_pc lp parport unix

Signature · 5 lines
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Email: [email protected]
Ph: 91-80-51776329
#1 lore raw

<snip>

Quoted 2 lines
Quoted 2 lines

DEVPATH=/module/sysensor SUBSYSTEM=module[17192146.124000] Unable to handle kernel paging request at virtual address 080c9566

The address looks like a user space address. Since sys_open() passes user space arguments - in this case a pointer to the filename. Are you derefencing the pointer correctly?

I think the handler should first copy_from_user().

Moreover your stack is

[17192146.124000] Call Trace:
[17192146.124000]  [<c01c6384>] vscnprintf+0x17/0x24
[17192146.124000]  [<c0116c7d>] vprintk+0x62/0x22a
[17192146.124000]  [<c02a8682>] int3+0x1e/0x24
[17192146.124000]  [<c0116c18>] printk+0xe/0x11
[17192146.124000]  [<e05610ac>] jsys_open+0x1d/0x28 [sysensor]
[17192146.124000]  [<c0102cef>] sysenter_past_esp+0x54/0x75
[17192146.124000] Code: 77 03 c6 03 20 4d 43 85 ed 7f f1 e9 9e 01 00

00 89 f0 89 fa 83 c6 04 8b 08 b8 19 14 2d c0 81 f9 ff 0f 00 00 0f 46 c8 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 f6 04 24 10 89 c7 75

and in the code posted, there is no printk in jsys_open(). Have you sent a revised version of your probe module?

Regards,
Balbir

#2 lore raw
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

DEVPATH=/module/sysensor SUBSYSTEM=module[17192146.124000] Unable to handle kernel paging request at virtual address 080c9566

The address looks like a user space address. Since sys_open() passes user space arguments - in this case a pointer to the filename. Are you derefencing the pointer correctly?

I think the handler should first copy_from_user().

User must not call copy_from_user() in the handler, since preemption is disabled and the copy_from_user might cause a page fault that might sleep if the user page is not in the memory. Although the latest patch posted on lkml tries to fixup the exception, it may some times not succeed and the data collected might be incorrect.

Quoted 10 lines

Moreover your stack is

[17192146.124000] Call Trace:
[17192146.124000]  [<c01c6384>] vscnprintf+0x17/0x24
[17192146.124000]  [<c0116c7d>] vprintk+0x62/0x22a
[17192146.124000]  [<c02a8682>] int3+0x1e/0x24
[17192146.124000]  [<c0116c18>] printk+0xe/0x11
[17192146.124000]  [<e05610ac>] jsys_open+0x1d/0x28 [sysensor]
[17192146.124000]  [<c0102cef>] sysenter_past_esp+0x54/0x75
[17192146.124000] Code: 77 03 c6 03 20 4d 43 85 ed 7f f1 e9 9e 01 00
Quoted 6 lines

00 89 f0 89 fa 83 c6 04 8b 08 b8 19 14 2d c0 81 f9 ff 0f 00 00 0f 46 c8 89 c8 eb 06 <80> 38 00 74 07 40 4a 83 fa ff 75 f4 29 c8 f6 04 24 10 89 c7 75

and in the code posted, there is no printk in jsys_open(). Have you sent a revised version of your probe module?

Also from the above stack trace, looks like you had a int3 elsewhere(in printk) also when jsys_open() was executed.

Thanks
Prasanna

Signature · 5 lines
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Email: [email protected]
Ph: 91-80-51776329
#3 lore raw
Quoted 8 lines
Quoted 1 line

I think the handler should first copy_from_user().

User must not call copy_from_user() in the handler, since preemption is disabled and the copy_from_user might cause a page fault that might sleep if the user page is not in the memory. Although the latest patch posted on lkml tries to fixup the exception, it may some times not succeed and the data collected might be incorrect.

Yes, you are right. I forgot about the probe handler requirements. In that case you need to come up with your own trick to get the user space data. Also look at/use systemtap.

Balbir