diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-03-18 21:33:31 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-23 06:13:46 -0400 |
commit | ae60f0710ae6b33092267ef8ac853c498f6d3e5d (patch) | |
tree | 8c4a775731ed4019dc57b6fec7503753ed6d3b98 /arch/x86/kernel/traps.c | |
parent | 383f3af3f88aadafe1fcf1948987ad538683fb8c (diff) |
x86/asm/entry: Use user_mode_ignore_vm86() where appropriate
A few of the user_mode() checks in traps.c are immediately after
explicit checks for vm86 mode. Change them to user_mode_ignore_vm86().
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brad Spengler <spender@grsecurity.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/0b324d5b75c3402be07f8d3c6245ed7f4995029e.1426728647.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r-- | arch/x86/kernel/traps.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 277341128b47..1136961a679b 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -208,7 +208,7 @@ do_trap_no_signal(struct task_struct *tsk, int trapnr, char *str, | |||
208 | return -1; | 208 | return -1; |
209 | } | 209 | } |
210 | #endif | 210 | #endif |
211 | if (!user_mode(regs)) { | 211 | if (!user_mode_ignore_vm86(regs)) { |
212 | if (!fixup_exception(regs)) { | 212 | if (!fixup_exception(regs)) { |
213 | tsk->thread.error_code = error_code; | 213 | tsk->thread.error_code = error_code; |
214 | tsk->thread.trap_nr = trapnr; | 214 | tsk->thread.trap_nr = trapnr; |
@@ -471,7 +471,7 @@ do_general_protection(struct pt_regs *regs, long error_code) | |||
471 | #endif | 471 | #endif |
472 | 472 | ||
473 | tsk = current; | 473 | tsk = current; |
474 | if (!user_mode(regs)) { | 474 | if (!user_mode_ignore_vm86(regs)) { |
475 | if (fixup_exception(regs)) | 475 | if (fixup_exception(regs)) |
476 | goto exit; | 476 | goto exit; |
477 | 477 | ||
@@ -688,7 +688,7 @@ dotraplinkage void do_debug(struct pt_regs *regs, long error_code) | |||
688 | * We already checked v86 mode above, so we can check for kernel mode | 688 | * We already checked v86 mode above, so we can check for kernel mode |
689 | * by just checking the CPL of CS. | 689 | * by just checking the CPL of CS. |
690 | */ | 690 | */ |
691 | if ((dr6 & DR_STEP) && !user_mode(regs)) { | 691 | if ((dr6 & DR_STEP) && !user_mode_ignore_vm86(regs)) { |
692 | tsk->thread.debugreg6 &= ~DR_STEP; | 692 | tsk->thread.debugreg6 &= ~DR_STEP; |
693 | set_tsk_thread_flag(tsk, TIF_SINGLESTEP); | 693 | set_tsk_thread_flag(tsk, TIF_SINGLESTEP); |
694 | regs->flags &= ~X86_EFLAGS_TF; | 694 | regs->flags &= ~X86_EFLAGS_TF; |