projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d83727
)
amdkfd: use calloc instead of kzalloc to avoid integer overflow
author
Dave Airlie
<airlied@redhat.com>
Thu, 11 Apr 2024 20:11:25 +0000
(06:11 +1000)
committer
Dave Airlie
<airlied@redhat.com>
Fri, 12 Apr 2024 01:11:59 +0000
(11:11 +1000)
This uses calloc instead of doing the multiplication which might
overflow.
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index f9631f4b1a02ca5121d7b382fe128c47c7718ec5..55aa74cbc5325e23451aa255dd5ce016e0aa4df8 100644
(file)
--- a/
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@
-779,8
+779,8
@@
static int kfd_ioctl_get_process_apertures_new(struct file *filp,
* nodes, but not more than args->num_of_nodes as that is
* the amount of memory allocated by user
*/
- pa = k
zalloc((sizeof(struct kfd_process_device_apertures) *
-
args->num_of_nodes),
GFP_KERNEL);
+ pa = k
calloc(args->num_of_nodes, sizeof(struct kfd_process_device_apertures),
+ GFP_KERNEL);
if (!pa)
return -ENOMEM;