Commit c3c124b2 authored by Mike Rapoport's avatar Mike Rapoport Committed by Zheng Zengkai
Browse files

memblock: ensure there is no overflow in memblock_overlaps_region()

mainline inclusion
from mainline-v5.14-rc1
commit 023accf5
category: bugfix
bugzilla: 172285 https://gitee.com/openeuler/kernel/issues/I4DDEL



-----------------------------------------------

There maybe an overflow in memblock_overlaps_region() if it is called with
base and size such that

	base + size > PHYS_ADDR_MAX

Make sure that memblock_overlaps_region() caps the size to prevent such
overflow and remove now duplicated call to memblock_cap_size() from
memblock_is_region_reserved().

Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
Tested-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarChen Huang <chenhuang5@huawei.com>
Reviewed-by: default avatarChen Wandun <chenwandun@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2998129b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment