Message ID | 20200330222309.5eTk9ZUJH%akpm@linux-foundation.org |
---|---|
State | Superseded |
Headers | show |
Series | [merged] mm-sparse-fix-kernel-crash-with-pfn_section_valid-check.patch removed from -mm tree | 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)