diff options
author | Prasanna S Panchamukhi <prasanna@in.ibm.com> | 2005-09-06 18:19:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:59 -0400 |
commit | 0f2fbdcbb041f9087da42f8ac2e81f2817098d2a (patch) | |
tree | 3f54f91ca6972c6567cfe529b33fafb622b2d51c /arch/x86_64/kernel/traps.c | |
parent | 3d97ae5b958855ac007b6f56a0f94ab8ade09e9e (diff) |
[PATCH] kprobes: prevent possible race conditions x86_64 changes
This patch contains the x86_64 architecture specific changes to prevent the
possible race conditions.
Signed-off-by: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/traps.c')
-rw-r--r-- | arch/x86_64/kernel/traps.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 6ead433a3885..f238d6078a5a 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/moduleparam.h> | 30 | #include <linux/moduleparam.h> |
31 | #include <linux/nmi.h> | 31 | #include <linux/nmi.h> |
32 | #include <linux/kprobes.h> | ||
32 | 33 | ||
33 | #include <asm/system.h> | 34 | #include <asm/system.h> |
34 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
@@ -419,8 +420,9 @@ void die_nmi(char *str, struct pt_regs *regs) | |||
419 | do_exit(SIGSEGV); | 420 | do_exit(SIGSEGV); |
420 | } | 421 | } |
421 | 422 | ||
422 | static void do_trap(int trapnr, int signr, char *str, | 423 | static void __kprobes do_trap(int trapnr, int signr, char *str, |
423 | struct pt_regs * regs, long error_code, siginfo_t *info) | 424 | struct pt_regs * regs, long error_code, |
425 | siginfo_t *info) | ||
424 | { | 426 | { |
425 | conditional_sti(regs); | 427 | conditional_sti(regs); |
426 | 428 | ||
@@ -504,7 +506,8 @@ DO_ERROR(18, SIGSEGV, "reserved", reserved) | |||
504 | DO_ERROR(12, SIGBUS, "stack segment", stack_segment) | 506 | DO_ERROR(12, SIGBUS, "stack segment", stack_segment) |
505 | DO_ERROR( 8, SIGSEGV, "double fault", double_fault) | 507 | DO_ERROR( 8, SIGSEGV, "double fault", double_fault) |
506 | 508 | ||
507 | asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) | 509 | asmlinkage void __kprobes do_general_protection(struct pt_regs * regs, |
510 | long error_code) | ||
508 | { | 511 | { |
509 | conditional_sti(regs); | 512 | conditional_sti(regs); |
510 | 513 | ||
@@ -622,7 +625,7 @@ asmlinkage void default_do_nmi(struct pt_regs *regs) | |||
622 | io_check_error(reason, regs); | 625 | io_check_error(reason, regs); |
623 | } | 626 | } |
624 | 627 | ||
625 | asmlinkage void do_int3(struct pt_regs * regs, long error_code) | 628 | asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) |
626 | { | 629 | { |
627 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { | 630 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { |
628 | return; | 631 | return; |
@@ -653,7 +656,8 @@ asmlinkage struct pt_regs *sync_regs(struct pt_regs *eregs) | |||
653 | } | 656 | } |
654 | 657 | ||
655 | /* runs on IST stack. */ | 658 | /* runs on IST stack. */ |
656 | asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code) | 659 | asmlinkage void __kprobes do_debug(struct pt_regs * regs, |
660 | unsigned long error_code) | ||
657 | { | 661 | { |
658 | unsigned long condition; | 662 | unsigned long condition; |
659 | struct task_struct *tsk = current; | 663 | struct task_struct *tsk = current; |