aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/mpx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/mpx.c')
-rw-r--r--arch/x86/mm/mpx.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
index 59726aaf4671..0d1c47cbbdd6 100644
--- a/arch/x86/mm/mpx.c
+++ b/arch/x86/mm/mpx.c
@@ -881,9 +881,10 @@ static int mpx_unmap_tables(struct mm_struct *mm,
881 * the virtual address region start...end have already been split if 881 * the virtual address region start...end have already been split if
882 * necessary, and the 'vma' is the first vma in this range (start -> end). 882 * necessary, and the 'vma' is the first vma in this range (start -> end).
883 */ 883 */
884void mpx_notify_unmap(struct mm_struct *mm, struct vm_area_struct *vma, 884void mpx_notify_unmap(struct mm_struct *mm, unsigned long start,
885 unsigned long start, unsigned long end) 885 unsigned long end)
886{ 886{
887 struct vm_area_struct *vma;
887 int ret; 888 int ret;
888 889
889 /* 890 /*
@@ -902,11 +903,12 @@ void mpx_notify_unmap(struct mm_struct *mm, struct vm_area_struct *vma,
902 * which should not occur normally. Being strict about it here 903 * which should not occur normally. Being strict about it here
903 * helps ensure that we do not have an exploitable stack overflow. 904 * helps ensure that we do not have an exploitable stack overflow.
904 */ 905 */
905 do { 906 vma = find_vma(mm, start);
907 while (vma && vma->vm_start < end) {
906 if (vma->vm_flags & VM_MPX) 908 if (vma->vm_flags & VM_MPX)
907 return; 909 return;
908 vma = vma->vm_next; 910 vma = vma->vm_next;
909 } while (vma && vma->vm_start < end); 911 }
910 912
911 ret = mpx_unmap_tables(mm, start, end); 913 ret = mpx_unmap_tables(mm, start, end);
912 if (ret) 914 if (ret)