Skip to contentSkip to conversation

Early call_usermodehelper causes double fault on x86_64

DISCUSSION Chris Wright 2 participants 3 messages Oct 27, 2004 – Oct 28, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

I'm seeing a double fault on recent (2.6.10-rc1-bk) kernels during driver_init(). The upcall to userspace gets far enough to schedule the work, khelper picks it up, calls kernel_thread, the child thread does execve, then double faults. Bootup continues, I get three more double faults, then the system appears fine (even w/ continued upcalls).

I have an example of the fault below. It shows a rip and rsp of 0. I poked about a bit and see that the FAKE_STACK_FRAME $0 in arch/x86-64/kernel/entry.S sets up a 0 rip, and if I change the \rip in that macro call, that's the rip in the double fault. Any ideas on further debugging?

thanks,
-chris

double fault: 0000 [1] PREEMPT SMP
CPU 1

Modules linked in:
Pid: 9, comm: khelper Tainted: G   M  2.6.10-rc1
RIP: 0010:[<0000000000000000>] [<0000000000000000>]
RSP: 0000:0000000000000000  EFLAGS: 00010202
RAX: 0000000000000000 RBX: 000001007ff09dc8 RCX: 000001007ff0e870
RDX: 000001003fff9e88 RSI: 000001007ff09e58 RDI: ffffffff805b8fe0
RBP: 00000000ffffffff R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000000 R12: 0000010037e87120
R13: 0000000000000206 R14: 000001007ff09dc8 R15: ffffffff80149200
FS:  0000000000000000(0000) GS:ffffffff816daa40(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: 0000000000000000 CR3: 000000007ff0a000 CR4: 00000000000006e0
Process khelper (pid: 9, threadinfo 000001000258c000, task 000001007ff0e870)
Stack: 0000010037ea8e58 0000000000000000 0000010037ea8f58 0000000000000000 
       0000000000000001 ffffffff80111f78 0000000000000004 0000010037ea8f58 
       0000000000000000 0000000000000000 
Call Trace:<ffffffff80111f78>{show_registers+200} <ffffffff8011222b>{__die+155} 
       <ffffffff801122a6>{die+54} <ffffffff80112bbf>{do_double_fault+175} 
       <ffffffff801118ed>{double_fault+125} <ffffffff80149200>{__call_usermodehelper+0} 
       

Code:  Bad RIP value.

RIP [<0000000000000000>] RSP <0000000000000000>

#1 lore raw
Quoted 8 lines · Chris Wright

Hi,

I'm seeing a double fault on recent (2.6.10-rc1-bk) kernels during driver_init(). The upcall to userspace gets far enough to schedule the work, khelper picks it up, calls kernel_thread, the child thread does execve, then double faults. Bootup continues, I get three more double faults, then the system appears fine (even w/ continued upcalls).

Quoted 5 lines

I have an example of the fault below. It shows a rip and rsp of 0. I poked about a bit and see that the FAKE_STACK_FRAME $0 in arch/x86-64/kernel/entry.S sets up a 0 rip, and if I change the \rip in that macro call, that's the rip in the double fault. Any ideas on further debugging?

It looks like do_execve returned with a zero return without executing start_thread properly. I would add a printk to all error exits in the execve path and see which one triggers.

-Andi

#2 lore raw
Quoted 3 lines · * Andi Kleen ([email protected]) wrote:

It looks like do_execve returned with a zero return without executing start_thread properly. I would add a printk to all error exits in the execve path and see which one triggers.

Yup, you're right. There are no binfmts registered, so search_binary_handler terminates and returns 0, not an x86_64 specific problem at all.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net