]>
Commit | Line | Data |
---|---|---|
1046336c JR |
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.. | |
7 | */ | |
8 | - if (in_interrupt() || !mm) | |
9 | - goto no_context; | |
10 | + if (tsk->in_page_fault || in_interrupt() || !mm) | |
11 | + goto must_oops; | |
12 | ||
13 | + tsk->in_page_fault = 1; | |
14 | down_read(&mm->mmap_sem); | |
15 | ||
16 | vma = find_vma(mm, address); | |
17 | @@ -256,6 +257,7 @@ good_area: | |
18 | tsk->thread.screen_bitmap |= 1 << bit; | |
19 | } | |
20 | up_read(&mm->mmap_sem); | |
21 | + tsk->in_page_fault = 0; | |
22 | return; | |
23 | ||
24 | /* | |
25 | @@ -264,6 +266,7 @@ good_area: | |
26 | */ | |
27 | bad_area: | |
28 | up_read(&mm->mmap_sem); | |
29 | + tsk->in_page_fault = 0; | |
30 | ||
31 | /* User mode accesses just cause a SIGSEGV */ | |
32 | if (error_code & 4) { | |
33 | @@ -304,6 +307,7 @@ no_context: | |
34 | * terminate things with extreme prejudice. | |
35 | */ | |
36 | ||
37 | +must_oops: | |
38 | bust_spinlocks(1); | |
39 | ||
40 | if (address < PAGE_SIZE) | |
41 | @@ -336,6 +340,7 @@ out_of_memory: | |
42 | goto survive; | |
43 | } | |
44 | up_read(&mm->mmap_sem); | |
45 | + tsk->in_page_fault = 0; | |
46 | printk("VM: killing process %s\n", tsk->comm); | |
47 | if (error_code & 4) | |
48 | do_exit(SIGKILL); | |
49 | @@ -343,6 +348,7 @@ out_of_memory: | |
50 | ||
1046336c JR |
51 | do_sigbus: |
52 | up_read(&mm->mmap_sem); | |
53 | + tsk->in_page_fault = 0; | |
54 | ||
55 | /* | |
56 | * Send a sigbus, regardless of whether we were in kernel | |
57 | diff -urNp linux-890/include/linux/sched.h linux-900/include/linux/sched.h | |
58 | --- linux-890/include/linux/sched.h | |
59 | +++ linux-900/include/linux/sched.h | |
60 | @@ -339,7 +339,7 @@ struct task_struct { | |
61 | int pdeath_signal; /* The signal sent when the parent dies */ | |
62 | /* ??? */ | |
63 | unsigned long personality; | |
64 | - int did_exec:1; | |
65 | + int did_exec:1, in_page_fault:1; | |
66 | unsigned task_dumpable:1; | |
67 | pid_t pid; | |
68 | pid_t pgrp; |