Message ID | 20230728105512.2258393-1-rppt@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Revert "mm,memblock: reset memblock.reserved to system init state to prevent UAF" | expand |
On Fri, 28 Jul 2023 at 03:55, Mike Rapoport <rppt@kernel.org> wrote: > > Linus, do you prefer a pull request or to pick it right away? I took it. Linus
diff --git a/mm/memblock.c b/mm/memblock.c index c39b36378f5d..f9e61e565a53 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -374,10 +374,6 @@ void __init memblock_discard(void) kfree(memblock.reserved.regions); else memblock_free_late(addr, size); - /* Reset to prevent UAF from stray frees. */ - memblock.reserved.regions = memblock_reserved_init_regions; - memblock.reserved.cnt = 1; - memblock_remove_region(&memblock.reserved, 0); } if (memblock.memory.regions != memblock_memory_init_regions) {