Commit 47b36f9e authored by Dan Carpenter's avatar Dan Carpenter Committed by Jialin Zhang
Browse files

xen/grants: prevent integer overflow in gnttab_dma_alloc_pages()

stable inclusion
from stable-v5.10.142
commit 5d0d46e6255aa87bbca0e6831648dcecd2a7ebfd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6CSFH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5d0d46e6255aa87bbca0e6831648dcecd2a7ebfd



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

[ Upstream commit e9ea0b30 ]

The change from kcalloc() to kvmalloc() means that arg->nr_pages
might now be large enough that the "args->nr_pages << PAGE_SHIFT" can
result in an integer overflow.

Fixes: b3f7931f ("xen/gntdev: switch from kcalloc() to kvcalloc()")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/YxDROJqu/RPvR0bi@kili


Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent def9694f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment