Skip to content

Commit f5e5518

Browse files
author
Ben Skeggs
committed
drm/nouveau/nvif: allow userspace access to its own client object
Regression from "abi16: implement limited interoperability with usif/nvif". Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 0d7fc24 commit f5e5518

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/gpu/drm/nouveau/nouveau_drm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
#include <nvif/client.h>
4141
#include <nvif/device.h>
42+
#include <nvif/ioctl.h>
4243

4344
#include <drmP.h>
4445

@@ -65,9 +66,10 @@ struct nouveau_drm_tile {
6566
};
6667

6768
enum nouveau_drm_object_route {
68-
NVDRM_OBJECT_NVIF = 0,
69+
NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
6970
NVDRM_OBJECT_USIF,
7071
NVDRM_OBJECT_ABI16,
72+
NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
7173
};
7274

7375
enum nouveau_drm_notify_route {

drivers/gpu/drm/nouveau/nouveau_usif.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ 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-
argv->v0.owner = NVDRM_OBJECT_USIF;
316+
if (argv->v0.object == 0ULL)
317+
argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
318+
else
319+
argv->v0.owner = NVDRM_OBJECT_USIF;
317320
} else
318321
goto done;
319322

0 commit comments

Comments
 (0)