Commit 5538fdaa authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hugetlb fix

Patch from Rohit Seth

It fixes the problem which Andrea noted in his initial review of the
hugetlb code:

"In short doing "addr = vma->vm_end" and then checking if vm_end + len
 is below vm_next->vm_start is broken, because there's no guarantee
 that "addr" will be a largepage aligned address.  the LPAGE_ALIGN in
 found_addr should be dropped becaue moving the addr ahead without
 checking that addr+len doesn't then fall into a vma, will generate
 do_munmaps and in turn userspace mem corruption."
parent bce5aeb5
......@@ -272,10 +272,9 @@ get_addr(unsigned long addr, unsigned long len)
return -ENOMEM;
if (!vma || ((addr + len) < vma->vm_start))
goto found_addr;
addr = vma->vm_end;
addr = HPAGE_ALIGN(vma->vm_end);
}
found_addr:
addr = HPAGE_ALIGN(addr);
return addr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment