aboutsummaryrefslogtreecommitdiffstats
path: root/mm/sparse.c
diff options
authorLinus Torvalds <torvalds@linux-foundation.org>2020-03-29 10:40:31 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-03-29 10:40:31 -0700
commit570203ec830dd451b8804cdef8036f7fca9f0311 (patch)
treecebdd249624e00d5aed6f24e94f0b743944ccfba /mm/sparse.c
parentab93e984dbb41578b41208cee52ce4e709951eb2 (diff)
parentb943f045a9af9fd02f923e43fe8d7517e9961701 (diff)
downloadlinux-master.tar.gz
Merge branch 'akpm' (patches from Andrew)HEADmaster
Merge vm fixes from Andrew Morton: "5 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: mm/sparse: fix kernel crash with pfn_section_valid check mm: fork: fix kernel_stack memcg stats for various stack implementations hugetlb_cgroup: fix illegal access to memory drivers/base/memory.c: indicate all memory blocks as removable mm/swapfile.c: move inode_lock out of claim_swapfile
Diffstat (limited to 'mm/sparse.c')
-rw-r--r--mm/sparse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/sparse.c b/mm/sparse.c
index aadb7298dcefda..65599e8bd63656 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -781,6 +781,12 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages,
ms->usage = NULL;
}
memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr);
+ /*
+ * Mark the section invalid so that valid_section()
+ * return false. This prevents code from dereferencing
+ * ms->usage array.
+ */
+ ms->section_mem_map &= ~SECTION_HAS_MEM_MAP;
}
if (section_is_early && memmap)