aboutsummaryrefslogtreecommitdiff
path: root/lib/mpi/mpi-cmp.c
diff options
context:
space:
mode:
authorVlastimil Babka <[email protected]>2019-10-14 14:12:07 -0700
committerLinus Torvalds <[email protected]>2019-10-14 15:04:01 -0700
commita2e9a5afce080226edbf1882d63d99bf32070e9e (patch)
treef838a20edbf1b5627a41accd52cdfa11e334205a /lib/mpi/mpi-cmp.c
parent3f36d8669457605910cb7a40089b485949569c41 (diff)
mm, compaction: fix wrong pfn handling in __reset_isolation_pfn()
Florian and Dave reported [1] a NULL pointer dereference in __reset_isolation_pfn(). While the exact cause is unclear, staring at the code revealed two bugs, which might be related. One bug is that if zone starts in the middle of pageblock, block_page might correspond to different pfn than block_pfn, and then the pfn_valid_within() checks will check different pfn's than those accessed via struct page. This might result in acessing an unitialized page in CONFIG_HOLES_IN_ZONE configs. The other bug is that end_page refers to the first page of next pageblock and not last page of current pageblock. The online and valid check is then wrong and with sections, the while (page < end_page) loop might wander off actual struct page arrays. [1] https://lore.kernel.org/linux-xfs/[email protected]/ Link: http://lkml.kernel.org/r/[email protected] Fixes: 6b0868c820ff ("mm/compaction.c: correct zone boundary handling when resetting pageblock skip hints") Signed-off-by: Vlastimil Babka <[email protected]> Reported-by: Florian Weimer <[email protected]> Reported-by: Dave Chinner <[email protected]> Acked-by: Mel Gorman <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-cmp.c')
0 files changed, 0 insertions, 0 deletions