[PATCH] char/agp: Disable frontend without CONFIG_DRM_LEGACY

Thomas Zimmermann tzimmermann at suse.de
Wed Nov 18 08:02:08 UTC 2020


Hi

Am 17.11.20 um 22:40 schrieb Daniel Vetter:
> It's probably full of bugs ready for exploiting by userspace. And
> there's not going to be any userspace for this without any of the drm
> legacy drivers enabled too. So just couple it together.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> Cc: David Airlie <airlied at linux.ie>
> Cc: Adam Jackson <ajax at redhat.com>
> ---
>  drivers/char/agp/Makefile | 6 +++++-
>  drivers/char/agp/agp.h    | 5 +++++
>  2 files changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile
> index cb2497d157f6..90ed8c789e48 100644
> --- a/drivers/char/agp/Makefile
> +++ b/drivers/char/agp/Makefile
> @@ -1,7 +1,11 @@
>  # SPDX-License-Identifier: GPL-2.0
> -agpgart-y := backend.o frontend.o generic.o isoch.o
> +agpgart-y := backend.o generic.o isoch.o
>  
> +ifeq ($(CONFIG_DRM_LEGACY),y)
>  agpgart-$(CONFIG_COMPAT)	+= compat_ioctl.o
> +agpgart-y			+= frontend.o
> +endif
> +
>  
>  obj-$(CONFIG_AGP)		+= agpgart.o
>  obj-$(CONFIG_AGP_ALI)		+= ali-agp.o
> diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
> index 4eb1c772ded7..bb09d64cd51e 100644
> --- a/drivers/char/agp/agp.h
> +++ b/drivers/char/agp/agp.h
> @@ -186,8 +186,13 @@ int agp_add_bridge(struct agp_bridge_data *bridge);
>  void agp_remove_bridge(struct agp_bridge_data *bridge);
>  
>  /* Frontend routines. */
> +#if IS_ENABLED(CONFIG_DRM_LEGACY)
>  int agp_frontend_initialize(void);
>  void agp_frontend_cleanup(void);
> +#else
> +static inline int agp_frontend_initialize(void) { return 0; }
> +static inline void agp_frontend_cleanup(void) {}
> +#endif

There's one non-legacy driver that uses these agp structures, which is
radeon. Does this change affect radeon?

Best regards
Thomas

>  
>  /* Generic routines. */
>  void agp_generic_enable(struct agp_bridge_data *bridge, u32 mode);
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer


More information about the dri-devel mailing list