From b1e17d355419c03c3e82cbebc49d2cb1233a1c5c Mon Sep 17 00:00:00 2001 From: Zhou Guanghui Date: Thu, 3 Nov 2022 06:42:03 +0000 Subject: [PATCH] mm/sharepool: fix the incorrect judgement of the addr range hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5XQS4 CVE: NA -------------------------------- The address range of dvpp is [start, start + size), the value of start + size can be out of the address range. Signed-off-by: Zhou Guanghui --- mm/share_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/share_pool.c b/mm/share_pool.c index 4f76ecf742c4..68e8f5c93a1f 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -3634,7 +3634,7 @@ bool mg_sp_config_dvpp_range(size_t start, size_t size, int device_id, int pid) /* NOTE: check the start address */ if (pid < 0 || size <= 0 || size > MMAP_SHARE_POOL_16G_SIZE || device_id < 0 || device_id >= MAX_DEVID || !is_online_node_id(device_id) - || !is_sp_dynamic_dvpp_addr(start) || !is_sp_dynamic_dvpp_addr(start + size)) + || !is_sp_dynamic_dvpp_addr(start) || !is_sp_dynamic_dvpp_addr(start + size - 1)) return false; ret = get_task(pid, &tsk); -- GitLab