Skip to content

Commit 9c7a11e

Browse files
Ben Skeggsgregkh
authored andcommitted
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>
1 parent 1507ea6 commit 9c7a11e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/nouveau/nouveau_usif.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
313313
if (nvif_unpack(argv->v0, 0, 0, true)) {
314314
/* block access to objects not created via this interface */
315315
owner = argv->v0.owner;
316-
if (argv->v0.object == 0ULL)
316+
if (argv->v0.object == 0ULL &&
317+
argv->v0.type != NVIF_IOCTL_V0_DEL)
317318
argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
318319
else
319320
argv->v0.owner = NVDRM_OBJECT_USIF;

0 commit comments

Comments
 (0)