]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 05:54:39 +0000 (07:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 05:54:39 +0000 (07:54 +0200)
added patches:
amdkfd-use-calloc-instead-of-kzalloc-to-avoid-integer-overflow.patch

queue-4.19/amdkfd-use-calloc-instead-of-kzalloc-to-avoid-integer-overflow.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/amdkfd-use-calloc-instead-of-kzalloc-to-avoid-integer-overflow.patch b/queue-4.19/amdkfd-use-calloc-instead-of-kzalloc-to-avoid-integer-overflow.patch
new file mode 100644 (file)
index 0000000..d18c55c
--- /dev/null
@@ -0,0 +1,32 @@
+From 3b0daecfeac0103aba8b293df07a0cbaf8b43f29 Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@redhat.com>
+Date: Fri, 12 Apr 2024 06:11:25 +1000
+Subject: amdkfd: use calloc instead of kzalloc to avoid integer overflow
+
+From: Dave Airlie <airlied@redhat.com>
+
+commit 3b0daecfeac0103aba8b293df07a0cbaf8b43f29 upstream.
+
+This uses calloc instead of doing the multiplication which might
+overflow.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_chardev.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+@@ -923,8 +923,8 @@ static int kfd_ioctl_get_process_apertur
+        * nodes, but not more than args->num_of_nodes as that is
+        * the amount of memory allocated by user
+        */
+-      pa = kzalloc((sizeof(struct kfd_process_device_apertures) *
+-                              args->num_of_nodes), GFP_KERNEL);
++      pa = kcalloc(args->num_of_nodes, sizeof(struct kfd_process_device_apertures),
++                   GFP_KERNEL);
+       if (!pa)
+               return -ENOMEM;
index c513745046688015ba3b74dd4f9735feebb6b967..3f24a23cc284ff4eb44a63bacac18a3572b0df45 100644 (file)
@@ -169,3 +169,4 @@ vmci-fix-possible-memcpy-run-time-warning-in-vmci_datagram_invoke_guest_handler.
 erspan-check-ifla_gre_erspan_ver-is-set.patch
 ip_gre-do-not-report-erspan-version-on-gre-interface.patch
 initramfs-fix-populate_initrd_image-section-mismatch.patch
+amdkfd-use-calloc-instead-of-kzalloc-to-avoid-integer-overflow.patch