Message ID | 20200329021729.BYOHDz5tg%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
--- a/mm/sparse.c~mm-sparse-fix-kernel-crash-with-pfn_section_valid-check +++ a/mm/sparse.c @@ -781,6 +781,12 @@ static void section_deactivate(unsigned 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)