1 diff -urNp linux-890/arch/i386/mm/fault.c linux-900/arch/i386/mm/fault.c
2 --- linux-890/arch/i386/mm/fault.c
3 +++ linux-900/arch/i386/mm/fault.c
4 @@ -178,9 +178,10 @@ asmlinkage void do_page_fault(struct pt_
5 * If we're in an interrupt or have no user
6 * context, we must not take the fault..
8 - if (in_interrupt() || !mm)
10 + if (tsk->in_page_fault || in_interrupt() || !mm)
13 + tsk->in_page_fault = 1;
14 down_read(&mm->mmap_sem);
16 vma = find_vma(mm, address);
17 @@ -256,6 +257,7 @@ good_area:
18 tsk->thread.screen_bitmap |= 1 << bit;
20 up_read(&mm->mmap_sem);
21 + tsk->in_page_fault = 0;
25 @@ -264,6 +266,7 @@ good_area:
28 up_read(&mm->mmap_sem);
29 + tsk->in_page_fault = 0;
31 /* User mode accesses just cause a SIGSEGV */
33 @@ -304,6 +307,7 @@ no_context:
34 * terminate things with extreme prejudice.
40 if (address < PAGE_SIZE)
41 @@ -336,6 +340,7 @@ out_of_memory:
44 up_read(&mm->mmap_sem);
45 + tsk->in_page_fault = 0;
46 printk("VM: killing process %s\n", tsk->comm);
49 @@ -343,6 +348,7 @@ out_of_memory:
52 up_read(&mm->mmap_sem);
53 + tsk->in_page_fault = 0;
56 * Send a sigbus, regardless of whether we were in kernel
57 diff -urNp linux-890/arch/x86_64/mm/fault.c linux-900/arch/x86_64/mm/fault.c
58 --- linux-890/arch/x86_64/mm/fault.c
59 +++ linux-900/arch/x86_64/mm/fault.c
60 @@ -141,10 +141,11 @@ asmlinkage void do_page_fault(struct pt_
61 * If we're in an interrupt or have no user
62 * context, we must not take the fault..
64 - if (in_interrupt() || !mm)
66 + if (tsk->in_page_fault || in_interrupt() || !mm)
70 + tsk->in_page_fault = 1;
71 down_read(&mm->mmap_sem);
73 vma = find_vma(mm, address);
74 @@ -202,6 +203,7 @@ good_area:
77 up_read(&mm->mmap_sem);
78 + tsk->in_page_fault = 0;
82 @@ -210,6 +212,7 @@ good_area:
85 up_read(&mm->mmap_sem);
86 + tsk->in_page_fault = 0;
90 @@ -248,6 +251,7 @@ no_context:
91 * terminate things with extreme prejudice.
98 @@ -269,7 +273,8 @@ no_context:
101 up_read(&mm->mmap_sem);
102 - if (current->pid == 1) {
103 + tsk->in_page_fault = 0;
104 + if (tsk->pid == 1) {
105 tsk->policy |= SCHED_YIELD;
108 @@ -281,6 +286,7 @@ out_of_memory:
111 up_read(&mm->mmap_sem);
112 + tsk->in_page_fault = 0;
115 * Send a sigbus, regardless of whether we were in kernel
116 diff -urNp linux-890/include/linux/sched.h linux-900/include/linux/sched.h
117 --- linux-890/include/linux/sched.h
118 +++ linux-900/include/linux/sched.h
119 @@ -339,7 +339,7 @@ struct task_struct {
120 int pdeath_signal; /* The signal sent when the parent dies */
122 unsigned long personality;
124 + int did_exec:1, in_page_fault:1;