From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] virgl: fix caps ioctl size check.
Date: Tue, 13 Feb 2018 10:26:30 +1000 [thread overview]
Message-ID: <20180213002630.6869-1-airlied@gmail.com> (raw)
From: Dave Airlie <airlied@redhat.com>
The size check seems backwards, if userspace gives us a size
larger it is probably asking for a newer version of the caps,
so we just fill in the caps version we have at the smaller
size, and it can work it out from there.
Userspace will probably still need a fallback as old
kernel are out there.
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 5720a0d4ac0a..5d5f79508100 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -497,7 +497,7 @@ static int virtio_gpu_get_caps_ioctl(struct drm_device *dev,
}
size = vgdev->capsets[found_valid].max_size;
- if (args->size > size) {
+ if (size > args->size) {
spin_unlock(&vgdev->display_info_lock);
return -EINVAL;
}
--
2.14.3
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2018-02-13 0:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 0:26 Dave Airlie [this message]
2018-02-13 0:28 ` [PATCH] virgl: fix caps ioctl size check Stéphane Marchesin
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=20180213002630.6869-1-airlied@gmail.com \
--to=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.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.