lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240905123348.3077-1-jose.exposito89@gmail.com>
Date: Thu,  5 Sep 2024 14:33:48 +0200
From: José Expósito <jose.exposito89@...il.com>
To: louis.chauvet@...tlin.com
Cc: airlied@...il.com,
	arthurgrillo@...eup.net,
	daniel@...ll.ch,
	dri-devel@...ts.freedesktop.org,
	hamohammed.sa@...il.com,
	jeremie.dautheribes@...tlin.com,
	linux-kernel@...r.kernel.org,
	maarten.lankhorst@...ux.intel.com,
	mairacanal@...eup.net,
	melissa.srw@...il.com,
	miquel.raynal@...tlin.com,
	mripard@...nel.org,
	nicolejadeyee@...gle.com,
	rodrigosiqueiramelo@...il.com,
	seanpaul@...gle.com,
	thomas.petazzoni@...tlin.com,
	tzimmermann@...e.de
Subject: [PATCH RFC 04/15] drm/vkms: Add a validation function for vkms configuration

> As the configuration will be used by userspace, add a validator to avoid
> creating a broken DRM device

This is something I considered to include in my configfs series, however,
I'm not sure if the set of rules used to validate a device configuration
are already implemented somewhere in the DRM core and we could try to
expose them to avoid duplicating them.

I'd be nice if someone with a better understanding of the DRM core code
could give us some pointers about the best way to implemet these validation
rules.

Also, if we end up implemeting the rules in VKMS, it'd be nice to print
to dmesg some information so the user can figure out what and why failed.

> 
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
> ---
>  drivers/gpu/drm/vkms/vkms_config.c |  5 +++++
>  drivers/gpu/drm/vkms/vkms_config.h | 14 ++++++++++++++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
> index ad5d814e6e83..d8348af9587e 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.c
> +++ b/drivers/gpu/drm/vkms/vkms_config.c
> @@ -21,6 +21,11 @@ void vkms_config_destroy(struct vkms_config *config)
>  	kfree(config);
>  }
>  
> +bool vkms_config_is_valid(struct vkms_config *config)
> +{
> +	return true;
> +}
> +
>  static int vkms_config_show(struct seq_file *m, void *data)
>  {
>  	struct drm_debugfs_entry *entry = m->private;
> diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
> index b28483173874..363f5bc8f64b 100644
> --- a/drivers/gpu/drm/vkms/vkms_config.h
> +++ b/drivers/gpu/drm/vkms/vkms_config.h
> @@ -29,4 +29,18 @@ void vkms_config_register_debugfs(struct vkms_device *vkms_device);
>  struct vkms_config *vkms_config_create(void);
>  void vkms_config_destroy(struct vkms_config *config);
>  
> +/**
> + * vkms_config_is_valid() - Validate a configuration
> + *
> + * Check if all the property defined in the configuration are valids. This will return false for
> + * example if:
> + * - no or many primary planes are present;
> + * - the default rotation of a plane is not in its supported rotation;
> + * - a CRTC don't have any encoder...
> + *
> + * @vkms_config: Configuration to validate
> + */
> +bool vkms_config_is_valid(struct vkms_config *vkms_config);
> +
> +
>  #endif //_VKMS_CONFIG_H
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ