diff options
author | Helge Deller <deller@gmx.de> | 2013-10-01 15:54:46 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-18 10:45:44 -0400 |
commit | 77587e89405f5d8225a0e750df254bcc2dcb73e1 (patch) | |
tree | 6acb42f3326029c880b710de86bd2e45ceddb841 /arch | |
parent | 40ee05de350259890492ceb4f23017470c553217 (diff) |
parisc: fix interruption handler to respect pagefault_disable()
commit 59b33f148cc08fb33cbe823fca1e34f7f023765e upstream.
Running an "echo t > /proc/sysrq-trigger" crashes the parisc kernel. The
problem is, that in print_worker_info() we try to read the workqueue info via
the probe_kernel_read() functions which use pagefault_disable() to avoid
crashes like this:
probe_kernel_read(&pwq, &worker->current_pwq, sizeof(pwq));
probe_kernel_read(&wq, &pwq->wq, sizeof(wq));
probe_kernel_read(name, wq->name, sizeof(name) - 1);
The problem here is, that the first probe_kernel_read(&pwq) might return zero
in pwq and as such the following probe_kernel_reads() try to access contents of
the page zero which is read protected and generate a kernel segfault.
With this patch we fix the interruption handler to call parisc_terminate()
directly only if pagefault_disable() was not called (in which case
preempt_count()==0). Otherwise we hand over to the pagefault handler which
will try to look up the faulting address in the fixup tables.
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/parisc/kernel/traps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 04e47c6a4562..b3f87a3b4bce 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -805,14 +805,14 @@ void notrace handle_interruption(int code, struct pt_regs *regs) | |||
805 | else { | 805 | else { |
806 | 806 | ||
807 | /* | 807 | /* |
808 | * The kernel should never fault on its own address space. | 808 | * The kernel should never fault on its own address space, |
809 | * unless pagefault_disable() was called before. | ||
809 | */ | 810 | */ |
810 | 811 | ||
811 | if (fault_space == 0) | 812 | if (fault_space == 0 && !in_atomic()) |
812 | { | 813 | { |
813 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); | 814 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_PANIC); |
814 | parisc_terminate("Kernel Fault", regs, code, fault_address); | 815 | parisc_terminate("Kernel Fault", regs, code, fault_address); |
815 | |||
816 | } | 816 | } |
817 | } | 817 | } |
818 | 818 | ||