]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb5ddb20043767da4f6e13860cf9b499d8f8a682d
treea69307192d34334c6869cfe33b6fea4e358de718
parentca8ba2f025bc87d0796a49cb60bf5c1096a4fce5
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