Commit faf89705 authored by Liu Xiang's avatar Liu Xiang Committed by Yang Yingliang
Browse files

mm: hugetlb: fix type of delta parameter and related local variables in gather_surplus_pages()

mainline inclusion
from mainline-v5.11-rc1
commit 0a4f3d1b
category: bugfix
bugzilla: NA
CVE: NA

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

On 64-bit machine, delta variable in hugetlb_acct_memory() may be larger
than 0xffffffff, but gather_surplus_pages() can only use the low 32-bit
value now.  So we need to fix type of delta parameter and related local
variables in gather_surplus_pages().

Link: https://lkml.kernel.org/r/1605793733-3573-1-git-send-email-liu.xiang@zlingsmart.com


Reported-by: default avatarMa Chenggong <ma.chenggong@zlingsmart.com>
Signed-off-by: default avatarLiu Xiang <liu.xiang@zlingsmart.com>
Signed-off-by: default avatarPan Jiagen <pan.jiagen@zlingsmart.com>
Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Cc: Liu Xiang <liuxiang_1999@126.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>

conflict:
	mm/hugetlb.c

Signed-off-by: default avatarTong Tiangen <tongtiangen@huawei.com>
Reviewed-by: default avatarChen Wandun <chenwandun@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent 946a53b7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment