All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: David Airlie <airlied@linux.ie>
Cc: security@kernel.org, "Marek Olšák" <marek.olsak@amd.com>,
	"Ilja Van Sprundel" <ivansprundel@ioactive.com>,
	dri-devel@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Leo Liu" <leo.liu@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"monk.liu" <monk.liu@amd.com>
Subject: [patch 4/4] drm/amdgpu: integer overflow in amdgpu_mode_dumb_create()
Date: Wed, 23 Sep 2015 14:00:59 +0300	[thread overview]
Message-ID: <20150923110059.GD16158@mwanda> (raw)
In-Reply-To: <13E61BCA7787794E89BDF39B8DE40C024D12E9F63F@ioaexchange.ioactive.local>

args->size is a u64.  arg->pitch and args->height are u32.  The
multiplication will overflow instead of using the high 32 bits as
intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
index dac14de..2023055 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
@@ -656,7 +656,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv,
 	int r;
 
 	args->pitch = amdgpu_align_pitch(adev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8);
-	args->size = args->pitch * args->height;
+	args->size = (u64)args->pitch * args->height;
 	args->size = ALIGN(args->size, PAGE_SIZE);
 
 	r = amdgpu_gem_object_create(adev, args->size, 0,
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      parent reply	other threads:[~2015-09-23 11:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <13E61BCA7787794E89BDF39B8DE40C024D12E9F63F@ioaexchange.ioactive.local>
2015-09-23 10:59 ` [patch 1/4] drm/amdgpu: unwind properly in amdgpu_cs_parser_init() Dan Carpenter
2015-09-23 14:16   ` Christian König
2015-09-23 17:13     ` Alex Deucher
2015-09-24  7:56       ` Dan Carpenter
2015-09-24 12:56         ` Deucher, Alexander
2015-09-25 11:36           ` [patch] drm/amdgpu: signedness bug " Dan Carpenter
2015-09-25 11:36             ` Dan Carpenter
2015-09-29 17:44             ` Alex Deucher
2015-09-29 17:44               ` Alex Deucher
2015-09-23 11:00 ` [patch 2/4] drm/amdgpu: integer overflow in amdgpu_info_ioctl() Dan Carpenter
2015-09-23 11:00 ` [patch 3/4] drm/amdgpu: info leak in amdgpu_gem_metadata_ioctl() Dan Carpenter
2015-09-23 11:00 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150923110059.GD16158@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ivansprundel@ioactive.com \
    --cc=leo.liu@amd.com \
    --cc=marek.olsak@amd.com \
    --cc=monk.liu@amd.com \
    --cc=security@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.