"unable to handle kernel null pointer derefernce at null" after trying to modprode driver

StackOverflow https://stackoverflow.com/questions/19669595

  •  01-07-2022
  •  | 
  •  

문제

I have a script that initializes a driver on startup, which worked beautifully before I enabled kernel tracing and recompiled the kernel to try and debug an issue with a piece of software. If I try to initialize the driver in any way (modprobe, insmod, etc) this output prints to the screen:

[   26.263308] BUG: unable to handle kernel NULL pointer dereference at   (null)
[   26.263322] IP: [<c108664d>] trace_module_notify+0x16b/0x20a
[   26.263325] *pde = 00000000 
[   26.263329] Oops: 0000 [#1] PREEMPT SMP 
[   26.263335] Modules linked in: phddrv(O+)
[   26.263343] Pid: 704, comm: insmod Tainted: G           O 3.6.3-rt9 #21 Advanced     Digital Logic, Inc CB4053/ADLS15PC
[   26.263346] EIP: 0060:[<c108664d>] EFLAGS: 00010213 CPU: 0
[   26.263350] EIP is at trace_module_notify+0x16b/0x20a
[   26.263353] EAX: ee6e9274 EBX: f082550c ECX: ee6e920c EDX: f082550c
[   26.263356] ESI: 00000000 EDI: ee6e92dc EBP: ee6ebf4c ESP: ee6ebf24    
[   26.263359]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[   26.263362] CR0: 8005003b CR2: 00000000 CR3: 2f2ea000 CR4: 000007d0
[   26.263365] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[   26.263367] DR6: ffff0ff0 DR7: 00000400
[   26.263371] Process insmod (pid: 704, ti=ee6ea000 task=ef218000 task.ti=ee6ea000)
[   26.263372] Stack:
[   26.263381]  ee6e9274 ee6e9344 ee6e92dc ee6e920c ee6e9274 ee6e9344 c2086424 c15a5d58
[   26.263388]  00000000 00000001 ee6ebf68 c1046d33 f082550c c15a51bc c15a3778 00000000
[   26.263396]  c15a3790 ee6ebf8c c1046fa9 fffffffd 00000000 f082550c 00000001 f082550c
[   26.263397] Call Trace:
[   26.263407]  [<c1046d33>] notifier_call_chain+0x2b/0x4d
[   26.263413]  [<c1046fa9>] __blocking_notifier_call_chain+0x3c/0x51
[   26.263419]  [<c1046fcf>] blocking_notifier_call_chain+0x11/0x13
[   26.263426]  [<c10671b7>] sys_init_module+0x57/0x190
[   26.263434]  [<c13a3d10>] sysenter_do_call+0x12/0x26
[   26.263489] Code: 00 c7 42 04 64 5d 5a c1 89 15 64 5d 5a c1 89 45 ec 8d 42 74 83 c2 0c 89 45 e8 89 55 e4 eb 19 57 8b 4d e4 89 da ff 75 ec ff 75 e8 <8b> 06 83 c6 04 e8 c2 fb ff ff 83 c4 0c 3b 75 f0 72 e2 eb 77 b8
[   26.263495] EIP: [<c108664d>] trace_module_notify+0x16b/0x20a SS:ESP 0068:ee6ebf24
[   26.263497] CR2: 0000000000000000
[   26.267381] ---[ end trace 0000000000000002 ]---

Any hint as to what is going on would be greatly appreciated!

도움이 되었습니까?

해결책

I got similar issue as yours (almost the same stack trace of panic). The root cause on my side is that after I changed the kernel config (enable trace point) I only rebuilt the kernel bzImage but forgot to rebuilt the ko modules! That may cause some execution mismatch between the new kernel and old ko modules. After rebuild and update both kernel image and ko modules, the issue is gone.

다른 팁

Somewhere in the driver there is a NULL pointer. A pointer variabile has value NULL and the driver is trying to use it.

myPtr->value;   /* if myPtr is NULL, this will raise the kernel oops */

You have to debug the driver to find where and why there is a NULL pointer

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top