From: Dave Hansen Date: Sun, 7 Jun 2015 18:37:02 +0000 (-0700) Subject: x86/mpx: Restrict the mmap() size check to bounds tables X-Git-Tag: firefly_0821_release~176^2~1627^2~14 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=eb099e5bc5457c42043e57cf0f4ce574669b9697;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c index 47e4a8564012..d6e02f3adee0 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);