diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-05-24 01:54:08 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-17 04:41:52 (GMT) |
commit | cf336eea809d10ea9df4e7096d7d916c3d07eeaf (patch) | |
tree | a512af429e4c32cc499bf872d2915927e222761f /drivers/gpu/drm/nouveau | |
parent | 16f733d8db525e0c3519888071b2e644b12717f7 (diff) | |
download | linux-cf336eea809d10ea9df4e7096d7d916c3d07eeaf.tar.xz |
drm/nouveau: prevent userspace from deleting client object
[ Upstream commit c966b6279f610a24ac1d42dcbe30e10fa61220b2 ]
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_usif.c | 3 |
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 08f9c6f..1fba386 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; |