From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933315AbbFIMdd (ORCPT ); Tue, 9 Jun 2015 08:33:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51924 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753958AbbFIMc4 (ORCPT ); Tue, 9 Jun 2015 08:32:56 -0400 Date: Tue, 9 Jun 2015 05:32:24 -0700 From: tip-bot for Dave Hansen Message-ID: Cc: dave@sr71.net, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de, mingo@kernel.org, akpm@linux-foundation.org, torvalds@linux-foundation.org, hpa@zytor.com, peterz@infradead.org Reply-To: linux-kernel@vger.kernel.org, dave@sr71.net, mingo@kernel.org, tglx@linutronix.de, dave.hansen@linux.intel.com, torvalds@linux-foundation.org, akpm@linux-foundation.org, peterz@infradead.org, hpa@zytor.com In-Reply-To: <20150607183702.222CEC2A@viggo.jf.intel.com> References: <20150607183702.222CEC2A@viggo.jf.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/fpu] x86/mpx: Restrict the mmap() size check to bounds tables Git-Commit-ID: eb099e5bc5457c42043e57cf0f4ce574669b9697 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: eb099e5bc5457c42043e57cf0f4ce574669b9697 Gitweb: http://git.kernel.org/tip/eb099e5bc5457c42043e57cf0f4ce574669b9697 Author: Dave Hansen AuthorDate: Sun, 7 Jun 2015 11:37:02 -0700 Committer: Ingo Molnar CommitDate: Tue, 9 Jun 2015 12:24:31 +0200 x86/mpx: Restrict the mmap() size check to bounds tables The comment and code here are confusing. We do not currently allocate the bounds directory in the kernel. Signed-off-by: Dave Hansen Reviewed-by: Thomas Gleixner Cc: Andrew Morton Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150607183702.222CEC2A@viggo.jf.intel.com Signed-off-by: Ingo Molnar --- arch/x86/mm/mpx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c index 47e4a856..d6e02f3 100644 --- a/arch/x86/mm/mpx.c +++ b/arch/x86/mm/mpx.c @@ -46,8 +46,8 @@ static unsigned long mpx_mmap(unsigned long len) vm_flags_t vm_flags; struct vm_area_struct *vma; - /* Only bounds table and bounds directory can be allocated here */ - if (len != MPX_BD_SIZE_BYTES && len != MPX_BT_SIZE_BYTES) + /* Only bounds table can be allocated here */ + if (len != MPX_BT_SIZE_BYTES) return -EINVAL; down_write(&mm->mmap_sem);