drm/qxl: integer overflow in qxl_process_single_command()
Subsystems (3)
PATCH 1/4 drm/qxl: integer overflow in qxl_process_single_command()
This size calculation can overflow on 32 bit systems leading to memory corruption.
Reported-by Ilja Van Sprundel <[email protected]>
Signed-off-by Dan Carpenter <[email protected]>
drivers/gpu/drm/qxl/qxl_ioctl.c +1 -1
@@ -168,7 +168,7 @@ static int qxl_process_single_command(struct qxl_device *qdev, 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 ;
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 23 lines
This size calculation can overflow on 32 bit systems leading to memory corruption.
Reported-by Ilja Van Sprundel <[email protected]>Signed-off-by Dan Carpenter <[email protected]>drivers/gpu/drm/qxl/qxl_ioctl.c +1
-1@@ -168,7 +168,7 @@ static int qxl_process_single_command(struct qxl_device *qdev, 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 );
drivers/gpu/drm/qxl/qxl_ioctl.c static int qxl_process_single_command(struct qxl_device *qdev, · line 173
Quoted 2 lines
drivers/gpu/drm/qxl/qxl_ioctl.c +0
-0if (!reloc_info)return -ENOMEM ;
Looks fine.
Acked.
Frediano
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel