Skip to content

Commit

Permalink
drm/nouveau/nvif: allow userspace access to its own client object
Browse files Browse the repository at this point in the history
Regression from "abi16: implement limited interoperability with
usif/nvif".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 25, 2015
1 parent 0d7fc24 commit f5e5518
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include <nvif/client.h>
#include <nvif/device.h>
#include <nvif/ioctl.h>

#include <drmP.h>

Expand All @@ -65,9 +66,10 @@ struct nouveau_drm_tile {
};

enum nouveau_drm_object_route {
NVDRM_OBJECT_NVIF = 0,
NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
NVDRM_OBJECT_USIF,
NVDRM_OBJECT_ABI16,
NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
};

enum nouveau_drm_notify_route {
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_usif.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ usif_ioctl(struct drm_file *filp, void __user *user, u32 argc)
if (nvif_unpack(argv->v0, 0, 0, true)) {
/* block access to objects not created via this interface */
owner = argv->v0.owner;
argv->v0.owner = NVDRM_OBJECT_USIF;
if (argv->v0.object == 0ULL)
argv->v0.owner = NVDRM_OBJECT_ANY; /* except client */
else
argv->v0.owner = NVDRM_OBJECT_USIF;
} else
goto done;

Expand Down

0 comments on commit f5e5518

Please sign in to comment.