Commit c2d2804b authored by Dave Airlie's avatar Dave Airlie Committed by Greg Kroah-Hartman

Revert "drm: allow render capable master with DRM_AUTH ioctls"

[ Upstream commit dbb92471 ]

This reverts commit 8059add0.

This commit while seemingly a good idea, breaks a radv check,
for a node being master because something succeeds where it failed
before now.

Apply the Linus rule, revert early and try again, we don't break
userspace.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 2df16141
...@@ -508,13 +508,6 @@ int drm_version(struct drm_device *dev, void *data, ...@@ -508,13 +508,6 @@ int drm_version(struct drm_device *dev, void *data,
return err; return err;
} }
static inline bool
drm_render_driver_and_ioctl(const struct drm_device *dev, u32 flags)
{
return drm_core_check_feature(dev, DRIVER_RENDER) &&
(flags & DRM_RENDER_ALLOW);
}
/** /**
* drm_ioctl_permit - Check ioctl permissions against caller * drm_ioctl_permit - Check ioctl permissions against caller
* *
...@@ -529,19 +522,14 @@ drm_render_driver_and_ioctl(const struct drm_device *dev, u32 flags) ...@@ -529,19 +522,14 @@ drm_render_driver_and_ioctl(const struct drm_device *dev, u32 flags)
*/ */
int drm_ioctl_permit(u32 flags, struct drm_file *file_priv) int drm_ioctl_permit(u32 flags, struct drm_file *file_priv)
{ {
const struct drm_device *dev = file_priv->minor->dev;
/* ROOT_ONLY is only for CAP_SYS_ADMIN */ /* ROOT_ONLY is only for CAP_SYS_ADMIN */
if (unlikely((flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN))) if (unlikely((flags & DRM_ROOT_ONLY) && !capable(CAP_SYS_ADMIN)))
return -EACCES; return -EACCES;
/* AUTH is only for master ... */ /* AUTH is only for authenticated or render client */
if (unlikely((flags & DRM_AUTH) && drm_is_primary_client(file_priv))) { if (unlikely((flags & DRM_AUTH) && !drm_is_render_client(file_priv) &&
/* authenticated ones, or render capable on DRM_RENDER_ALLOW. */ !file_priv->authenticated))
if (!file_priv->authenticated && return -EACCES;
!drm_render_driver_and_ioctl(dev, flags))
return -EACCES;
}
/* MASTER is only for master or control clients */ /* MASTER is only for master or control clients */
if (unlikely((flags & DRM_MASTER) && if (unlikely((flags & DRM_MASTER) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment