From e6a23a8df5daac8df54e414e054ff15440cf2e60 Mon Sep 17 00:00:00 2001 From: Zhou Guanghui Date: Thu, 3 Nov 2022 06:41:54 +0000 Subject: [PATCH] mm/sharepool: bugfix for 2M U2K hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5PZDX CVE: NA -------------------------------- We could determine if a userspace map is huge-mapped after walking its pagetable. So the uva_align should be calculated again after walking the pagetable if it is huge-mapped. Signed-off-by: Zhou Guanghui --- mm/share_pool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/share_pool.c b/mm/share_pool.c index ffaec8d250bb..0534987fcadc 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -3188,6 +3188,9 @@ static int __sp_walk_page_range(unsigned long uva, unsigned long size, sp_walk_data->pages = NULL; } + if (sp_walk_data->is_hugepage) + sp_walk_data->uva_aligned = ALIGN_DOWN(uva, PMD_SIZE); + return ret; } -- GitLab