diff options
author | Miles Chen <miles.chen@mediatek.com> | 2018-12-28 09:33:21 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 21:11:46 +0100 |
commit | c8f61cfc871fadfb73ad3eacd64fda457279e911 (patch) | |
tree | e66a7f8da6dc30887b8ab19afa71127a0493a84d /mm/sparse.c | |
parent | include/linux/slab.h: fix sparse warning in kmalloc_type() (diff) | |
download | linux-c8f61cfc871fadfb73ad3eacd64fda457279e911.tar.xz linux-c8f61cfc871fadfb73ad3eacd64fda457279e911.zip |
mm/page_owner: clamp read count to PAGE_SIZE
The (root-only) page owner read might allocate a large size of memory with
a large read count. Allocation fails can easily occur when doing high
order allocations.
Clamp buffer size to PAGE_SIZE to avoid arbitrary size allocation
and avoid allocation fails due to high order allocation.
[akpm@linux-foundation.org: use min_t()]
Link: http://lkml.kernel.org/r/1541091607-27402-1-git-send-email-miles.chen@mediatek.com
Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Joe Perches <joe@perches.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/sparse.c')
0 files changed, 0 insertions, 0 deletions