diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-08-27 13:23:11 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-29 21:08:26 -0400 |
commit | 62c9295f9dd250ea1bb2c8078642a275a9ce82f8 (patch) | |
tree | 841048e8ec8461d698673daacf0b151f8827794f /arch/x86 | |
parent | f5ad31158d60946b9fd18c8a79c283a6bc432430 (diff) |
kprobes/x86: Fix to add __kprobes to in-kernel fault handing functions
Add __kprobes to the functions which handle in-kernel fixable page
faults. Since kprobes can cause those in-kernel page faults by accessing
kprobe data structures, probing those fault functions will cause
fault-int3-loop (do_page_fault has already been marked as __kprobes).
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <20090827172311.8246.92725.stgit@localhost.localdomain>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/mm/fault.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index bfae139182ff..c322e59f2d10 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -38,7 +38,8 @@ enum x86_pf_error_code { | |||
38 | * Returns 0 if mmiotrace is disabled, or if the fault is not | 38 | * Returns 0 if mmiotrace is disabled, or if the fault is not |
39 | * handled by mmiotrace: | 39 | * handled by mmiotrace: |
40 | */ | 40 | */ |
41 | static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) | 41 | static inline int __kprobes |
42 | kmmio_fault(struct pt_regs *regs, unsigned long addr) | ||
42 | { | 43 | { |
43 | if (unlikely(is_kmmio_active())) | 44 | if (unlikely(is_kmmio_active())) |
44 | if (kmmio_handler(regs, addr) == 1) | 45 | if (kmmio_handler(regs, addr) == 1) |
@@ -46,7 +47,7 @@ static inline int kmmio_fault(struct pt_regs *regs, unsigned long addr) | |||
46 | return 0; | 47 | return 0; |
47 | } | 48 | } |
48 | 49 | ||
49 | static inline int notify_page_fault(struct pt_regs *regs) | 50 | static inline int __kprobes notify_page_fault(struct pt_regs *regs) |
50 | { | 51 | { |
51 | int ret = 0; | 52 | int ret = 0; |
52 | 53 | ||
@@ -239,7 +240,7 @@ void vmalloc_sync_all(void) | |||
239 | * | 240 | * |
240 | * Handle a fault on the vmalloc or module mapping area | 241 | * Handle a fault on the vmalloc or module mapping area |
241 | */ | 242 | */ |
242 | static noinline int vmalloc_fault(unsigned long address) | 243 | static noinline __kprobes int vmalloc_fault(unsigned long address) |
243 | { | 244 | { |
244 | unsigned long pgd_paddr; | 245 | unsigned long pgd_paddr; |
245 | pmd_t *pmd_k; | 246 | pmd_t *pmd_k; |
@@ -361,7 +362,7 @@ void vmalloc_sync_all(void) | |||
361 | * | 362 | * |
362 | * This assumes no large pages in there. | 363 | * This assumes no large pages in there. |
363 | */ | 364 | */ |
364 | static noinline int vmalloc_fault(unsigned long address) | 365 | static noinline __kprobes int vmalloc_fault(unsigned long address) |
365 | { | 366 | { |
366 | pgd_t *pgd, *pgd_ref; | 367 | pgd_t *pgd, *pgd_ref; |
367 | pud_t *pud, *pud_ref; | 368 | pud_t *pud, *pud_ref; |
@@ -858,7 +859,7 @@ static int spurious_fault_check(unsigned long error_code, pte_t *pte) | |||
858 | * There are no security implications to leaving a stale TLB when | 859 | * There are no security implications to leaving a stale TLB when |
859 | * increasing the permissions on a page. | 860 | * increasing the permissions on a page. |
860 | */ | 861 | */ |
861 | static noinline int | 862 | static noinline __kprobes int |
862 | spurious_fault(unsigned long error_code, unsigned long address) | 863 | spurious_fault(unsigned long error_code, unsigned long address) |
863 | { | 864 | { |
864 | pgd_t *pgd; | 865 | pgd_t *pgd; |