mm: use long type for page counts in mm_populate() and get_user_pages()
authorMichel Lespinasse <walken@google.com>
Sat, 23 Feb 2013 00:35:55 +0000 (16:35 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 24 Feb 2013 01:50:22 +0000 (17:50 -0800)
commit28a35716d317980ae9bc2ff2f84c33a3cda9e884
treea69307192d34334c6869cfe33b6fea4e358de718
parente0fb58152955142f48ed31c8c0541b53e094da6b
mm: use long type for page counts in mm_populate() and get_user_pages()

Use long type for page counts in mm_populate() so as to avoid integer
overflow when running the following test code:

int main(void) {
  void *p = mmap(NULL, 0x100000000000, PROT_READ,
                 MAP_PRIVATE | MAP_ANON, -1, 0);
  printf("p: %p\n", p);
  mlockall(MCL_CURRENT);
  printf("done\n");
  return 0;
}

Signed-off-by: Michel Lespinasse <walken@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/hugetlb.h
include/linux/mm.h
mm/hugetlb.c
mm/memory.c
mm/mlock.c
mm/nommu.c