summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2016-05-25 09:11:40 +0200
committerBen Skeggs <bskeggs@redhat.com>2017-01-31 11:05:25 +0100
commitc966b6279f610a24ac1d42dcbe30e10fa61220b2 (patch)
tree5cb56dcbfa4042779d22ec9c4979133cd4def201 /drivers/gpu
parentdrm/nouveau/fence/g84-: protect against concurrent access to semaphore buffers (diff)
downloadlinux-c966b6279f610a24ac1d42dcbe30e10fa61220b2.tar.xz
linux-c966b6279f610a24ac1d42dcbe30e10fa61220b2.zip
drm/nouveau: prevent userspace from deleting client object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_usif.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_usif.c b/drivers/gpu/drm/nouveau/nouveau_usif.c
index 08f9c6fa0f7f..1fba38622744 100644
--- a/drivers/gpu/drm/nouveau/nouveau_usif.c
+++ b/drivers/gpu/drm/nouveau/nouveau_usif.c
@@ -313,7 +313,8 @@ usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
if (!(ret = nvif_unpack(-ENOSYS, &data, &size, argv->v0, 0, 0, true))) {
/* block access to objects not created via this interface */
owner = argv->v0.owner;
- if (argv->v0.object == 0ULL)
+ if (argv->v0.object == 0ULL &&
+ argv->v0.type != NVIF_IOCTL_V0_DEL)
argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
else
argv->v0.owner = NVDRM_OBJECT_USIF;