Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Patch "drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command" has been added to the 3.14-stable tree
@ 2016-03-01 21:24 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-03-01 21:24 UTC (permalink / raw)
  To: kraxel, airlied, daniel.vetter, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-qxl-use-kmalloc_array-to-alloc-reloc_info-in-qxl_process_single_command.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 34855706c30d52b0a744da44348b5d1cc39fbe51 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 16 Feb 2016 14:25:00 +0100
Subject: drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command

From: Gerd Hoffmann <kraxel@redhat.com>

commit 34855706c30d52b0a744da44348b5d1cc39fbe51 upstream.

This avoids integer overflows on 32bit machines when calculating
reloc_info size, as reported by Alan Cox.

Cc: gnomes@lxorguk.ukuu.org.uk
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/qxl/qxl_ioctl.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/gpu/drm/qxl/qxl_ioctl.c
+++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
@@ -168,7 +168,8 @@ static int qxl_process_single_command(st
 		       cmd->command_size))
 		return -EFAULT;
 
-	reloc_info = kmalloc(sizeof(struct qxl_reloc_info) * cmd->relocs_num, GFP_KERNEL);
+	reloc_info = kmalloc_array(cmd->relocs_num,
+				   sizeof(struct qxl_reloc_info), GFP_KERNEL);
 	if (!reloc_info)
 		return -ENOMEM;
 


Patches currently in stable-queue which might be from kraxel@redhat.com are

queue-3.14/drm-qxl-use-kmalloc_array-to-alloc-reloc_info-in-qxl_process_single_command.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-03-01 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-01 21:24 Patch "drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command" has been added to the 3.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox