diff mbox series

[09/13] drm/omap: drop DRM_AUTH from DRM_RENDER_ALLOW ioctls

Message ID 20190527081741.14235-9-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show
Series [01/13] drm/amdgpu: introduce and honour DRM_FORCE_AUTH workaround | expand

Commit Message

Emil Velikov May 27, 2019, 8:17 a.m. UTC
From: Emil Velikov <emil.velikov@collabora.com>

The authentication can be circumvented, by design, by using the render
node.

From the driver POV there is no distinction between primary and render
nodes, thus we can drop the token.

Note: the outstanding DRM_AUTH instance is:
 - (badly coped) legacy DRI1 ioctl, which is a noop

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Emil Velikov June 6, 2019, 10:58 a.m. UTC | #1
On Mon, 27 May 2019 at 09:19, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>
> From: Emil Velikov <emil.velikov@collabora.com>
>
> The authentication can be circumvented, by design, by using the render
> node.
>
> From the driver POV there is no distinction between primary and render
> nodes, thus we can drop the token.
>
> Note: the outstanding DRM_AUTH instance is:
>  - (badly coped) legacy DRI1 ioctl, which is a noop
>
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
>
> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 1b9b6f5e48e1..f97781f9d936 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -491,19 +491,19 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
>
>  static const struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = {
>         DRM_IOCTL_DEF_DRV(OMAP_GET_PARAM, ioctl_get_param,
> -                         DRM_AUTH | DRM_RENDER_ALLOW),
> +                         DRM_RENDER_ALLOW),
>         DRM_IOCTL_DEF_DRV(OMAP_SET_PARAM, ioctl_set_param,
>                           DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
>         DRM_IOCTL_DEF_DRV(OMAP_GEM_NEW, ioctl_gem_new,
> -                         DRM_AUTH | DRM_RENDER_ALLOW),
> +                         DRM_RENDER_ALLOW),
>         /* Deprecated, to be removed. */
>         DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_PREP, drm_noop,
> -                         DRM_AUTH | DRM_RENDER_ALLOW),
> +                         DRM_RENDER_ALLOW),
>         /* Deprecated, to be removed. */
>         DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_FINI, drm_noop,
> -                         DRM_AUTH | DRM_RENDER_ALLOW),
> +                         DRM_RENDER_ALLOW),
>         DRM_IOCTL_DEF_DRV(OMAP_GEM_INFO, ioctl_gem_info,
> -                         DRM_AUTH | DRM_RENDER_ALLOW),
> +                         DRM_RENDER_ALLOW),
>  };
>
>  /*
> --
> 2.21.0
>
Humble poke?

Thanks,
Emil
Tomi Valkeinen June 6, 2019, 2:45 p.m. UTC | #2
Hi,

On 06/06/2019 13:58, Emil Velikov wrote:
> On Mon, 27 May 2019 at 09:19, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>>
>> From: Emil Velikov <emil.velikov@collabora.com>
>>
>> The authentication can be circumvented, by design, by using the render
>> node.
>>
>>  From the driver POV there is no distinction between primary and render
>> nodes, thus we can drop the token.
>>
>> Note: the outstanding DRM_AUTH instance is:
>>   - (badly coped) legacy DRI1 ioctl, which is a noop
>>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Cc: David Airlie <airlied@linux.ie>
>> Cc: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
>>
>> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
>> ---
>>   drivers/gpu/drm/omapdrm/omap_drv.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
>> index 1b9b6f5e48e1..f97781f9d936 100644
>> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
>> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
>> @@ -491,19 +491,19 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
>>
>>   static const struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = {
>>          DRM_IOCTL_DEF_DRV(OMAP_GET_PARAM, ioctl_get_param,
>> -                         DRM_AUTH | DRM_RENDER_ALLOW),
>> +                         DRM_RENDER_ALLOW),
>>          DRM_IOCTL_DEF_DRV(OMAP_SET_PARAM, ioctl_set_param,
>>                            DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
>>          DRM_IOCTL_DEF_DRV(OMAP_GEM_NEW, ioctl_gem_new,
>> -                         DRM_AUTH | DRM_RENDER_ALLOW),
>> +                         DRM_RENDER_ALLOW),
>>          /* Deprecated, to be removed. */
>>          DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_PREP, drm_noop,
>> -                         DRM_AUTH | DRM_RENDER_ALLOW),
>> +                         DRM_RENDER_ALLOW),
>>          /* Deprecated, to be removed. */
>>          DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_FINI, drm_noop,
>> -                         DRM_AUTH | DRM_RENDER_ALLOW),
>> +                         DRM_RENDER_ALLOW),
>>          DRM_IOCTL_DEF_DRV(OMAP_GEM_INFO, ioctl_gem_info,
>> -                         DRM_AUTH | DRM_RENDER_ALLOW),
>> +                         DRM_RENDER_ALLOW),
>>   };
>>
>>   /*
>> --
>> 2.21.0
>>
> Humble poke?

I have to say I'm not really familiar with the auth stuff. But 
considering that our use cases are quite trivial, and that it's a DRM 
wide change (so presumably it works =):

Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

  Tomi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 1b9b6f5e48e1..f97781f9d936 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -491,19 +491,19 @@  static int ioctl_gem_info(struct drm_device *dev, void *data,
 
 static const struct drm_ioctl_desc ioctls[DRM_COMMAND_END - DRM_COMMAND_BASE] = {
 	DRM_IOCTL_DEF_DRV(OMAP_GET_PARAM, ioctl_get_param,
-			  DRM_AUTH | DRM_RENDER_ALLOW),
+			  DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(OMAP_SET_PARAM, ioctl_set_param,
 			  DRM_AUTH | DRM_MASTER | DRM_ROOT_ONLY),
 	DRM_IOCTL_DEF_DRV(OMAP_GEM_NEW, ioctl_gem_new,
-			  DRM_AUTH | DRM_RENDER_ALLOW),
+			  DRM_RENDER_ALLOW),
 	/* Deprecated, to be removed. */
 	DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_PREP, drm_noop,
-			  DRM_AUTH | DRM_RENDER_ALLOW),
+			  DRM_RENDER_ALLOW),
 	/* Deprecated, to be removed. */
 	DRM_IOCTL_DEF_DRV(OMAP_GEM_CPU_FINI, drm_noop,
-			  DRM_AUTH | DRM_RENDER_ALLOW),
+			  DRM_RENDER_ALLOW),
 	DRM_IOCTL_DEF_DRV(OMAP_GEM_INFO, ioctl_gem_info,
-			  DRM_AUTH | DRM_RENDER_ALLOW),
+			  DRM_RENDER_ALLOW),
 };
 
 /*