[PATCH 0/3] of: reserved_mem: fix a few reserved memory issues
Wandun Chen <[email protected]>
| Newsgroups | org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Wandun Chen <[email protected]> This series fixes a few issues in the reserved-memory handling: 1. A region whose early reservation failed was still counted and initialized by the late scan, handing unprotected memory to a device. (patch 1) 2. A statically placed region overlapping an existing reservation was accepted, so the overlap could be used by two regions concurrently and freed on init failure. (patch 2) 3. A dynamically allocated no-map region was never returned to the buddy allocator when its driver init failed: only memblock_clear_nomap() was called, leaving the entry in memblock.reserved. (patch 3) Sashiko reported the original issue in [1]. This is sent for review now; given the v7.2 release is closing, there is no expectation to merge it this cycle. [1] https://lore.kernel.org/all/[email protected]/ Wandun Chen (3): of: reserved_mem: skip init for regions whose early reservation failed of: reserved_mem: reject statically placed regions overlapping existing reservations of: reserved_mem: release dynamically allocated no-map region on init failure drivers/of/of_reserved_mem.c | 69 ++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 14 deletions(-) -- 2.43.0