diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2007-06-06 23:34:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-07 20:05:03 -0400 |
commit | e5e3c84b70e58fc605635fd340fb8dba3cc59058 (patch) | |
tree | 7ebba42dc0a402ef54bcbd4552e1fe47c519de2b /arch | |
parent | c52ecdab06ff3b4d0f8914951eb74dc8b049f51c (diff) |
enable interrupts in user path of page fault.
This is a minor fix, but what is currently there is essentially wrong.
In do_page_fault, if the faulting address from user code happens to be
in kernel address space (int *p = (int*)-1; p = 0xbed;) then the
do_page_fault handler will jump over the local_irq_enable with the
goto bad_area_nosemaphore;
But the first line there sees this is user code and goes through the
process of sending a signal to send SIGSEGV to the user task. This whole
time interrupts are disabled and the task can not be preempted by a
higher priority task.
This patch always enables interrupts in the user path of the
bad_area_nosemaphore.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/mm/fault.c | 5 | ||||
-rw-r--r-- | arch/x86_64/mm/fault.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index 29d7d61543a1..1ecb3e43b523 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c | |||
@@ -458,6 +458,11 @@ bad_area: | |||
458 | bad_area_nosemaphore: | 458 | bad_area_nosemaphore: |
459 | /* User mode accesses just cause a SIGSEGV */ | 459 | /* User mode accesses just cause a SIGSEGV */ |
460 | if (error_code & 4) { | 460 | if (error_code & 4) { |
461 | /* | ||
462 | * It's possible to have interrupts off here. | ||
463 | */ | ||
464 | local_irq_enable(); | ||
465 | |||
461 | /* | 466 | /* |
462 | * Valid to do another page fault here because this one came | 467 | * Valid to do another page fault here because this one came |
463 | * from user space. | 468 | * from user space. |
diff --git a/arch/x86_64/mm/fault.c b/arch/x86_64/mm/fault.c index bfb62a13d7ee..635e58d443d7 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86_64/mm/fault.c | |||
@@ -476,6 +476,12 @@ bad_area: | |||
476 | bad_area_nosemaphore: | 476 | bad_area_nosemaphore: |
477 | /* User mode accesses just cause a SIGSEGV */ | 477 | /* User mode accesses just cause a SIGSEGV */ |
478 | if (error_code & PF_USER) { | 478 | if (error_code & PF_USER) { |
479 | |||
480 | /* | ||
481 | * It's possible to have interrupts off here. | ||
482 | */ | ||
483 | local_irq_enable(); | ||
484 | |||
479 | if (is_prefetch(regs, address, error_code)) | 485 | if (is_prefetch(regs, address, error_code)) |
480 | return; | 486 | return; |
481 | 487 | ||