Message ID | 20200326194130.KQt2jbeWd%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | + mm-sparse-fix-kernel-crash-with-pfn_section_valid-check-v2.patch added to -mm tree | expand |
--- a/mm/sparse.c~mm-sparse-fix-kernel-crash-with-pfn_section_valid-check-v2 +++ a/mm/sparse.c @@ -781,7 +781,11 @@ static void section_deactivate(unsigned ms->usage = NULL; } memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); - /* Mark the section invalid */ + /* + * 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; }