The patch titled Subject: memblock: add input size checking to memblock_find_region() has been removed from the -mm tree. Its filename was memblock-add-input-size-checking-to-memblock_find_region.patch This patch was dropped because other changes were merged, which wrecked this patch The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ From: Yinghai Lu <yinghai@xxxxxxxxxx> Subject: memblock: add input size checking to memblock_find_region() Make sure two callers have right inputs. and add print warning to catch other offending callers. Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx> Suggested-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx> Cc: Tejun Heo <tj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memblock.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN mm/memblock.c~memblock-add-input-size-checking-to-memblock_find_region mm/memblock.c --- a/mm/memblock.c~memblock-add-input-size-checking-to-memblock_find_region +++ a/mm/memblock.c @@ -85,7 +85,7 @@ static phys_addr_t __init_memblock membl long j; /* In case, huge size is requested */ - if (end < size) + if (WARN_ONCE(end < size, "memblock_find_region: wrong range [%#llx-%#llx] size %#llx", start, end, size)) return MEMBLOCK_ERROR; base = memblock_align_down((end - size), align); @@ -129,14 +129,14 @@ static phys_addr_t __init_memblock membl phys_addr_t memblocksize = memblock.memory.regions[i].size; phys_addr_t bottom, top, found; - if (memblocksize < size) - continue; if ((memblockbase + memblocksize) <= start) break; bottom = max(memblockbase, start); top = min(memblockbase + memblocksize, end); if (bottom >= top) continue; + if ((top - bottom) < size) + continue; found = memblock_find_region(bottom, top, size, align); if (found != MEMBLOCK_ERROR) return found; @@ -569,7 +569,7 @@ static phys_addr_t __init memblock_alloc int this_nid; this_end = memblock_nid_range(start, end, &this_nid); - if (this_nid == nid) { + if (this_nid == nid && (this_end - start) >= size) { phys_addr_t ret = memblock_find_region(start, this_end, size, align); if (ret != MEMBLOCK_ERROR && !memblock_add_region(&memblock.reserved, ret, size)) _ Patches currently in -mm which might be from yinghai@xxxxxxxxxx are linux-next.patch memblock-add-input-size-checking-to-memblock_find_region-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html