提交 7cbf4e98 编写于 作者: K Kunkun Jiang 提交者: Jialin Zhang

vfio/iommu_type1: replace kvmalloc with kvzalloc and kfree with kvfree

virt inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6FHYK
CVE: NA

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

For security purposes, kvzalloc is used to allocate memory. Because
the memory may be allocated by vmalloc. So we replace kfree with
kvfree here.
Reported-by: NZhaolong Wang <wangzhaolong1@huawei.com>
Signed-off-by: NKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 248da27c
......@@ -1129,7 +1129,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap,
int ret = 0;
bitmap_size = DIRTY_BITMAP_BYTES(size >> pgshift);
bitmap_buffer = kvmalloc(bitmap_size, GFP_KERNEL);
bitmap_buffer = kvzalloc(bitmap_size, GFP_KERNEL);
if (!bitmap_buffer) {
ret = -ENOMEM;
goto out;
......@@ -1179,7 +1179,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap,
}
out:
kfree(bitmap_buffer);
kvfree(bitmap_buffer);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册