From: Frediano Ziglio <fziglio@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dave Airlie <airlied@redhat.com>,
security@kernel.org,
Ilja Van Sprundel <ivansprundel@ioactive.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [patch 3/4] drm/qxl: array underflow in qxl_clientcap_ioctl()
Date: Thu, 17 Sep 2015 10:16:34 -0400 (EDT) [thread overview]
Message-ID: <1002571808.28239757.1442499394422.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20150917112352.GC4882@mwanda>
>
> We check that "byte" isn't writing beyond the end of the array but we
> also need to prevent array underflow.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c
> b/drivers/gpu/drm/qxl/qxl_ioctl.c
> index b2db482..552dc06 100644
> --- a/drivers/gpu/drm/qxl/qxl_ioctl.c
> +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
> @@ -372,7 +372,7 @@ static int qxl_clientcap_ioctl(struct drm_device *dev,
> void *data,
> {
> struct qxl_device *qdev = dev->dev_private;
> struct drm_qxl_clientcap *param = data;
> - int byte, idx;
> + unsigned int byte, idx;
>
> byte = param->index / 8;
> idx = param->index % 8;
>
Actually there is no underflow. param->index is unsigned so either byte and
idx are at the end positive as long as int is not less then 4 bytes (which
I don't think is supported under Linux).
However I agree with the patch.
Acked!
Frediano Ziglio
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-09-17 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 11:23 [patch 3/4] drm/qxl: array underflow in qxl_clientcap_ioctl() Dan Carpenter
2015-09-17 14:16 ` Frediano Ziglio [this message]
2015-09-17 19:06 ` Dan Carpenter
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=1002571808.28239757.1442499394422.JavaMail.zimbra@redhat.com \
--to=fziglio@redhat.com \
--cc=airlied@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ivansprundel@ioactive.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox