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

2018-02-23 Thread Keith Packard
Eric Anholt  writes:

> Any security concerns with a suid xserver here?

Not that I know of, but it's probably only a matter of someone smarter
than me looking? I think what I want is a command line option that is
disabled when the server is setuid (or, frankly, run as root at
all?). This is purely a hack to show the xlease program working and test
KMS and X leases without needing Mesa changes.

I'll rewrite this as a command line option, which presumably involves
adding an option to the general xfree86 set.

-- 
-keith


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

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

2018-02-23 Thread Eric Anholt
Keith Packard  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 
> ---
>  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?


signature.asc
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel