]> www.infradead.org Git - users/willy/linux.git/commit
mm/page_owner: clamp read count to PAGE_SIZE
authorMiles Chen <miles.chen@mediatek.com>
Wed, 5 Dec 2018 00:13:30 +0000 (11:13 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 5 Dec 2018 00:13:30 +0000 (11:13 +1100)
commit67381f4a15e006d166bcbcdd098b5e0cd713367d
treea10d316fb45792f1f550d89cc6cac6a850de815f
parente8499f6023b04adfab1f97a0e21852271d9a4aa3
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.

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: Stephen Rothwell <sfr@canb.auug.org.au>
mm/page_owner.c