[PATCH xserver 7/7] modesetting: Allow a DRM fd to be passed through XF86_VIDEO_MODESETTING_FD

Eric Anholt eric at anholt.net
Fri Feb 23 15:26:14 UTC 2018


Keith Packard <keithp at keithp.com> writes:

> This lets an application open a suitable DRM device and pass the file
> descriptor to the mode setting driver through an environment variable.
>
> There's a companion application, xlease, which creates a DRM master by
> leasing an output from another X server. That is available at
>
> 	git clone git://people.freedesktop.org/~keithp/xlease
>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  hw/xfree86/drivers/modesetting/driver.c | 29 ++++++++++++++++++++++++++++-
>  hw/xfree86/drivers/modesetting/driver.h |  1 +
>  2 files changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
> index 577559ea6..074872e97 100644
> --- a/hw/xfree86/drivers/modesetting/driver.c
> +++ b/hw/xfree86/drivers/modesetting/driver.c
> @@ -194,11 +194,28 @@ modesettingEntPtr ms_ent_priv(ScrnInfoPtr scrn)
>      return pPriv->ptr;
>  }
>  
> +static int
> +get_passed_fd(void)
> +{
> +    char *fdstr = getenv("XF86_VIDEO_MODESETTING_FD");

Any security concerns with a suid xserver here?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180223/7b34befb/attachment-0001.sig>


More information about the xorg-devel mailing list