From: Andy Lutomirski Date: Thu, 19 Mar 2015 01:33:27 +0000 (-0700) Subject: x86/mm/fault: Use TASK_SIZE_MAX in is_prefetch() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d31bf07f71a5568b48c5ed448e4299050469f615;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Borislav Petkov Cc: Brad Spengler Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/09156b63bad90a327827003c9e53faa82ef4c56e.1426728647.git.luto@kernel.org Signed-off-by: Ingo Molnar --- 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) instr = (void *)convert_ip_to_linear(current, regs); max_instr = instr + 15; - if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE) + if (user_mode(regs) && instr >= (unsigned char *)TASK_SIZE_MAX) return 0; while (instr < max_instr) {