diff options
Diffstat (limited to 'arch/i386/kernel/traps.c')
-rw-r--r-- | arch/i386/kernel/traps.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 54629bb5893a..09a58cb6daa7 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -363,8 +363,9 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long e | |||
363 | die(str, regs, err); | 363 | die(str, regs, err); |
364 | } | 364 | } |
365 | 365 | ||
366 | static void do_trap(int trapnr, int signr, char *str, int vm86, | 366 | static void __kprobes do_trap(int trapnr, int signr, char *str, int vm86, |
367 | struct pt_regs * regs, long error_code, siginfo_t *info) | 367 | struct pt_regs * regs, long error_code, |
368 | siginfo_t *info) | ||
368 | { | 369 | { |
369 | struct task_struct *tsk = current; | 370 | struct task_struct *tsk = current; |
370 | tsk->thread.error_code = error_code; | 371 | tsk->thread.error_code = error_code; |
@@ -460,7 +461,8 @@ DO_ERROR(12, SIGBUS, "stack segment", stack_segment) | |||
460 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) | 461 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) |
461 | DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0) | 462 | DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0) |
462 | 463 | ||
463 | fastcall void do_general_protection(struct pt_regs * regs, long error_code) | 464 | fastcall void __kprobes do_general_protection(struct pt_regs * regs, |
465 | long error_code) | ||
464 | { | 466 | { |
465 | int cpu = get_cpu(); | 467 | int cpu = get_cpu(); |
466 | struct tss_struct *tss = &per_cpu(init_tss, cpu); | 468 | struct tss_struct *tss = &per_cpu(init_tss, cpu); |
@@ -657,7 +659,7 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code) | |||
657 | 659 | ||
658 | ++nmi_count(cpu); | 660 | ++nmi_count(cpu); |
659 | 661 | ||
660 | if (!nmi_callback(regs, cpu)) | 662 | if (!rcu_dereference(nmi_callback)(regs, cpu)) |
661 | default_do_nmi(regs); | 663 | default_do_nmi(regs); |
662 | 664 | ||
663 | nmi_exit(); | 665 | nmi_exit(); |
@@ -665,7 +667,7 @@ fastcall void do_nmi(struct pt_regs * regs, long error_code) | |||
665 | 667 | ||
666 | void set_nmi_callback(nmi_callback_t callback) | 668 | void set_nmi_callback(nmi_callback_t callback) |
667 | { | 669 | { |
668 | nmi_callback = callback; | 670 | rcu_assign_pointer(nmi_callback, callback); |
669 | } | 671 | } |
670 | EXPORT_SYMBOL_GPL(set_nmi_callback); | 672 | EXPORT_SYMBOL_GPL(set_nmi_callback); |
671 | 673 | ||
@@ -676,7 +678,7 @@ void unset_nmi_callback(void) | |||
676 | EXPORT_SYMBOL_GPL(unset_nmi_callback); | 678 | EXPORT_SYMBOL_GPL(unset_nmi_callback); |
677 | 679 | ||
678 | #ifdef CONFIG_KPROBES | 680 | #ifdef CONFIG_KPROBES |
679 | fastcall void do_int3(struct pt_regs *regs, long error_code) | 681 | fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code) |
680 | { | 682 | { |
681 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) | 683 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) |
682 | == NOTIFY_STOP) | 684 | == NOTIFY_STOP) |
@@ -710,7 +712,7 @@ fastcall void do_int3(struct pt_regs *regs, long error_code) | |||
710 | * find every occurrence of the TF bit that could be saved away even | 712 | * find every occurrence of the TF bit that could be saved away even |
711 | * by user code) | 713 | * by user code) |
712 | */ | 714 | */ |
713 | fastcall void do_debug(struct pt_regs * regs, long error_code) | 715 | fastcall void __kprobes do_debug(struct pt_regs * regs, long error_code) |
714 | { | 716 | { |
715 | unsigned int condition; | 717 | unsigned int condition; |
716 | struct task_struct *tsk = current; | 718 | struct task_struct *tsk = current; |