From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbbCWMVO (ORCPT ); Mon, 23 Mar 2015 08:21:14 -0400 Received: from terminus.zytor.com ([198.137.202.10]:41157 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752737AbbCWMUd (ORCPT ); Mon, 23 Mar 2015 08:20:33 -0400 Date: Mon, 23 Mar 2015 05:20:00 -0700 From: tip-bot for Andy Lutomirski Message-ID: Cc: tglx@linutronix.de, dvlasenk@redhat.com, bp@alien8.de, spender@grsecurity.net, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, luto@kernel.org Reply-To: mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, luto@kernel.org, tglx@linutronix.de, dvlasenk@redhat.com, bp@alien8.de, spender@grsecurity.net In-Reply-To: <09156b63bad90a327827003c9e53faa82ef4c56e.1426728647.git.luto@kernel.org> References: <09156b63bad90a327827003c9e53faa82ef4c56e.1426728647.git.luto@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] x86/mm/fault: Use TASK_SIZE_MAX in is_prefetch() Git-Commit-ID: d31bf07f71a5568b48c5ed448e4299050469f615 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: d31bf07f71a5568b48c5ed448e4299050469f615 Gitweb: http://git.kernel.org/tip/d31bf07f71a5568b48c5ed448e4299050469f615 Author: Andy Lutomirski AuthorDate: Wed, 18 Mar 2015 18:33:27 -0700 Committer: Ingo Molnar CommitDate: Mon, 23 Mar 2015 10:08:20 +0100 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 --- arch/x86/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index ede025f..ae340d3 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) {