hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6XOIE CVE: NA
--------------------------------
The type of pfn is int, which can result in truncation. Change its type to unsigned long to fix the problem.
Fixes: eef7b4fd04a0 ("mm/dynamic_hugetlb: use pfn to traverse subpages") Signed-off-by: Liu Shixin liushixin2@huawei.com --- mm/dynamic_hugetlb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/dynamic_hugetlb.c b/mm/dynamic_hugetlb.c index 526d84870a60..8199ef893f4a 100644 --- a/mm/dynamic_hugetlb.c +++ b/mm/dynamic_hugetlb.c @@ -55,7 +55,8 @@ static void __hpool_split_gigantic_page(struct dhugetlb_pool *hpool, struct page { int nr_pages = 1 << (PUD_SHIFT - PAGE_SHIFT); int nr_blocks = 1 << (PMD_SHIFT - PAGE_SHIFT); - int i, pfn = page_to_pfn(page); + unsigned long pfn = page_to_pfn(page); + int i;
lockdep_assert_held(&hpool->lock); atomic_set(compound_mapcount_ptr(page), 0);