The patch titled Subject: mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix has been added to the -mm tree. Its filename is mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Michal Hocko <mhocko@xxxxxxxxxx> Subject: mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix Fix mremap.c and uprobes.c sites also. Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Wei Yang <richardw.yang@xxxxxxxxxxxxxxx> Cc: Konstantin Khlebnikov <khlebnikov@xxxxxxxxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: "Jérôme Glisse" <jglisse@xxxxxxxxxx> Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Cc: Rik van Riel <riel@xxxxxxxxxxx> Cc: Qian Cai <cai@xxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/events/uprobes.c | 2 +- mm/mremap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/kernel/events/uprobes.c~mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix +++ a/kernel/events/uprobes.c @@ -1448,7 +1448,7 @@ static int xol_add_vma(struct mm_struct /* Try to map as high as possible, this is only a hint. */ area->vaddr = get_unmapped_area(NULL, TASK_SIZE - PAGE_SIZE, PAGE_SIZE, 0, 0); - if (area->vaddr & ~PAGE_MASK) { + if (IS_ERR_VALUE(area->vaddr)) { ret = area->vaddr; goto fail; } --- a/mm/mremap.c~mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix +++ a/mm/mremap.c @@ -558,7 +558,7 @@ static unsigned long mremap_to(unsigned ret = get_unmapped_area(vma->vm_file, new_addr, new_len, vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT), map_flags); - if (offset_in_page(ret)) + if (IS_ERR_VALUE(ret)) goto out1; ret = move_vma(vma, addr, old_len, new_len, new_addr, locked, uf, @@ -706,7 +706,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, a vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT), map_flags); - if (offset_in_page(new_addr)) { + if (IS_ERR_VALUE(new_addr)) { ret = new_addr; goto out; } _ Patches currently in -mm which might be from mhocko@xxxxxxxxxx are mm-mmapc-use-is_err_value-to-check-return-value-of-get_unmapped_area-fix.patch