diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-03-18 21:33:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-03-23 05:08:20 -0400 |
commit | d31bf07f71a5568b48c5ed448e4299050469f615 (patch) | |
tree | 50fb2000bee0063edd49d3cc061e69e864a7d13f /arch/x86/mm/fault.c | |
parent | 1daeaa315164c60b937f56fe3848d4328c358eba (diff) |
x86/mm/fault: Use TASK_SIZE_MAX in is_prefetch()
This is slightly shorter and slightly faster. It's also more
correct: the split between user and kernel addresses is
TASK_SIZE_MAX, regardless of ti->flags.
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/09156b63bad90a327827003c9e53faa82ef4c56e.1426728647.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index ede025fb46f1..ae340d3761ca 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -148,7 +148,7 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) | |||
148 | instr = (void *)convert_ip_to_linear(current, regs); | 148 | instr = (void *)convert_ip_to_linear(current, regs); |
149 | max_instr = instr + 15; | 149 | max_instr = instr + 15; |
150 | 150 | ||
151 | if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE) | 151 | if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE_MAX) |
152 | return 0; | 152 | return 0; |
153 | 153 | ||
154 | while (instr < max_instr) { | 154 | while (instr < max_instr) { |