The patch titled Subject: mm/mlock.c: change count_mm_mlocked_page_nr return type has been added to the -mm tree. Its filename is mm-change-count_mm_mlocked_page_nr-return-type.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-change-count_mm_mlocked_page_nr-return-type.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-change-count_mm_mlocked_page_nr-return-type.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: swkhack <swkhack@xxxxxxxxx> Subject: mm/mlock.c: change count_mm_mlocked_page_nr return type On a 64-bit machine the value of "vma->vm_end - vma->vm_start" may be negative when using 32 bit ints and the "count >> PAGE_SHIFT"'s result will be wrong. So change the local variable and return value to unsigned long to fix the problem. Link: http://lkml.kernel.org/r/20190513023701.83056-1-swkhack@xxxxxxxxx Fixes: 0cf2f6f6dc60 ("mm: mlock: check against vma for actual mlock() size") Signed-off-by: swkhack <swkhack@xxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/mlock.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/mlock.c~mm-change-count_mm_mlocked_page_nr-return-type +++ a/mm/mlock.c @@ -636,11 +636,11 @@ static int apply_vma_lock_flags(unsigned * is also counted. * Return value: previously mlocked page counts */ -static int count_mm_mlocked_page_nr(struct mm_struct *mm, +static unsigned long count_mm_mlocked_page_nr(struct mm_struct *mm, unsigned long start, size_t len) { struct vm_area_struct *vma; - int count = 0; + unsigned long count = 0; if (mm == NULL) mm = current->mm; _ Patches currently in -mm which might be from swkhack@xxxxxxxxx are mm-change-count_mm_mlocked_page_nr-return-type.patch