You are not logged in.

#1 2016-12-05 14:24:05

maggie
Member
Registered: 2011-02-12
Posts: 255

Why does the modesetting driver need root

I read on the wiki that I have to create /etc/X11/Xwrapper.config allowing root if I use the modesetting driver. My laptop can use the intel driver without this so I am thinking why does the built-in modesetting driver need root and does it present a security concern.

https://wiki.archlinux.org/index.php/Xo … 28v1.16.29

Offline

#2 2016-12-05 14:36:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Why does the modesetting driver need root

maggie wrote:

I read on the wiki that I have to create /etc/X11/Xwrapper.config allowing root if I use the modesetting driver.

That is not in the page you linked and it is most definitely not true.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-12-05 15:04:07

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: Why does the modesetting driver need root

Sorry for not understanding this. The wiki says

"As of version 1.16 [4], Xorg may run with standard user privileges with the help of logind. The requirements for this are:
-systemd; version >=216 for multiple instances
-Starting X via xinit; display managers are not supported
-Kernel mode setting; implementations in proprietary display drivers fail auto-detection and require manually setting needs_root_rights = no in  /etc/X11/Xwrapper.config.
If you do not fit these requirements, re-enable root rights in /etc/X11/Xwrapper.config:
needs_root_rights = yes"

I am using lxdm on my laptop. After I removed the xf86-video-intel drivers and rebooted, Xorg doesn't start unless I make /etc/X11/Xwrapper.config that has "needs_root_rights = yes" in it like the page said. I don't need that file if I use xf86-video-intel drivers though.

Offline

#4 2016-12-05 15:20:22

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Why does the modesetting driver need root

Nothing in that list mentions a DDX at all, let alone the modesetting DDX.

What, exactly, is the problem you get when running X?

Online

#5 2016-12-05 16:54:20

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: Why does the modesetting driver need root

-Starting X via xinit; display managers are not supported

I am using lxdm on my laptop.

Well I see a contradiction here...

Offline

#6 2016-12-05 18:19:00

maggie
Member
Registered: 2011-02-12
Posts: 255

Re: Why does the modesetting driver need root

Scimmia wrote:

Nothing in that list mentions a DDX at all, let alone the modesetting DDX.

What, exactly, is the problem you get when running X?

The problem is that lxdm cannot start without xf86-intel-driver if I don't make the Xwrapper.config. If I install xf86-intel-driver it starts without Xwrapper.config.

Offline

#7 2016-12-05 18:28:33

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Why does the modesetting driver need root

@maggie - Just curious why you aren't using the intel driver?  From the benchmarks I have seen, it's faster.

I am confused by the 3 criteria outlined on the wiki.  I have all 3 satisfied on a kodi box and without /etc/X11/Xwrapper.config containing the root override, I cannot get kodi-standalone-service to start using the modesetting driver.  I will posts some before/after Xorg logs in a few.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2016-12-05 18:32:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Why does the modesetting driver need root

maggie wrote:
Scimmia wrote:

Nothing in that list mentions a DDX at all, let alone the modesetting DDX.

What, exactly, is the problem you get when running X?

The problem is that lxdm cannot start without xf86-intel-driver if I don't make the Xwrapper.config. If I install xf86-intel-driver it starts without Xwrapper.config.

As FlowIt pointed out, lxdm doesn't meet the criteria.

Online

#9 2016-12-05 18:49:04

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Why does the modesetting driver need root

Note that the AUR package I mentioned supplies /usr/lib/systemd/system/kodi.service which has ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt7 so I believe the 3 criteria are satisfied. But without /etc/X11/Xwrapper.config on the filesystem, kodi does not start.

With modesetting driver (ie no fx86-video-intel package) and without /etc/X11/Xwrapper.config the Xorg.log is written to /var/lib/kodi/.local/share/xorg/Xorg.0.log and kodi does not run.

% grep '(EE)\|(WW)' /var/lib/kodi/.local/share/xorg/Xorg.0.log
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   211.320] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[   211.320] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   211.320] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   211.323] (EE) Error systemd-logind returned paused fd for drm node
[   211.324] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   211.325] (WW) Warning, couldn't open module intel
[   211.325] (EE) Failed to load module "intel" (module does not exist, 0)
[   211.325] (WW) Warning, couldn't open module fbdev
[   211.325] (EE) Failed to load module "fbdev" (module does not exist, 0)
[   211.325] (WW) Warning, couldn't open module vesa
[   211.325] (EE) Failed to load module "vesa" (module does not exist, 0)
[   211.326] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[   211.402] (EE) modeset(0): drmSetMaster failed: Permission denied
[   211.402] (EE) 
[   211.402] (EE) AddScreen/ScreenInit failed for driver 0
[   211.402] (EE) 
[   211.402] (EE) 
[   211.402] (EE) Please also check the log file at "/var/lib/kodi/.local/share/xorg/Xorg.0.log" for additional information.
[   211.402] (EE) 
[   211.441] (EE) Server terminated with error (1). Closing log file.

With modesetting driver (ie no fx86-video-intel package) and with /etc/X11/Xwrapper.config the Xorg.log is written to /var/log/Xorg.0.log and kodi does run.

% grep '(EE)\|(WW)' /var/log/Xorg.0.log
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   310.461] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[   310.461] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   310.461] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   310.463] (EE) Error systemd-logind returned paused fd for drm node
[   310.464] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   310.466] (WW) Warning, couldn't open module intel
[   310.466] (EE) Failed to load module "intel" (module does not exist, 0)
[   310.466] (WW) Warning, couldn't open module fbdev
[   310.466] (EE) Failed to load module "fbdev" (module does not exist, 0)
[   310.466] (WW) Warning, couldn't open module vesa
[   310.466] (EE) Failed to load module "vesa" (module does not exist, 0)
[   310.815] (EE) Error systemd-logind returned paused fd for drm node

Finally, with xf86-video-intel and without /etc/X11/Xwrapper.config, the Xorg.log is written to /var/log/Xorg.0.log and kodi does run.

% grep '(EE)\|(WW)' /var/log/Xorg.0.log
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   429.520] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[   429.520] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   429.520] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   429.522] (EE) Error systemd-logind returned paused fd for drm node
[   429.523] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   429.524] (WW) Warning, couldn't open module fbdev
[   429.524] (EE) Failed to load module "fbdev" (module does not exist, 0)
[   429.524] (WW) Warning, couldn't open module vesa
[   429.524] (EE) Failed to load module "vesa" (module does not exist, 0)
[   429.525] (WW) Falling back to old probe method for modesetting
[   429.568] (EE) Error systemd-logind returned paused fd for drm node

Unless I am missing something, I believe the wiki's 3 criteria are incorrect.

@maggie - As others have pointed out, lxdm is not xinit.

Last edited by graysky (2016-12-05 18:50:07)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2016-12-05 19:00:08

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Why does the modesetting driver need root

Note the wiki says what is supported: if you meet those criteria, x should work without need for Xwrapper.config.  This is *not* the same as saying every deviation from the criteria will necessarily require Xwrapper.config, just that they might.

"If A then B" does not require "If not A then not B".

If you are able to use the intel driver with a display manager without Xwrapper.config, thats great.  You got lucky and something that (according to the wiki) is not officially supported just happened to work ok.  That's not surprising.  But don't be surprised either if it stops working at some point.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2016-12-05 19:21:29

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Why does the modesetting driver need root

the wiki wrote:

The requirements for this are:

* [[systemd]]; version >=216 for multiple instances
* Starting X via [[xinit]]; display managers are not supported
* [[Kernel mode setting]]; implementations in proprietary display drivers fail auto-detection and require manually setting 'needs_root_rights = no' in /etc/X11/Xwrapper.config.

If you do not fit these requirements, re-enable root rights

I'm still confused since my system meets all 3 criteria but it does not work without adding that file.
1) Has systemd >=216
2) Starts X via xinit
3) Using KMS with native modesetting driver.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#12 2016-12-05 20:03:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Why does the modesetting driver need root

My reply was to the topic of this thread - your issue is different.  You do not run xinit from a logged in user session but instead run it as a 'kodi' user on a non-logged in tty.  Frankly I'm amazed this works at all under any conditions.  As for the conditions in the wiki, you trimmed out the part right above the three bullet points saying this works thanks to logind.  Your kodi service hack takes logind out of the picture.

My broader logic remains, if you do things right, everything should work;  If you do things wrong, they may or may not work and neither outcome is particularly interesting nor surprising.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2016-12-05 20:04:49

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: Why does the modesetting driver need root

you still got kms with the intel driver, ie. the criteria is a red herring. what seems to be the case is that with the Xorg modesetting driver you run into permission errors, what's either a bug OR the (built in) modesetting driver is really not capable of this (should probably be mentioned in the wiki if confirmable)

Offline

#14 2016-12-05 20:11:58

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Why does the modesetting driver need root

Trilby wrote:

Note the wiki says what is supported: if you meet those criteria, x should work without need for Xwrapper.config.

No, it says that you can run X without elevated privileges if you meet those criteria.

The bit about display managers not being supported just means that when you use a DM, you're still (limited to) running X with elevated rights. It doesn't necessarily mean that you need Xwrapper.config. The default is to use autodetection.

The wiki gives an example where autodetection keeps suid rights when it doesn't have to (proprietary drivers with systemd and without DM) and this thread seems to provide an example where autodetection drops suid rights when it shouldn't (modesetting driver with DM).

Offline

#15 2016-12-05 20:13:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,595
Website

Re: Why does the modesetting driver need root

@Trilby - For the record, the kodi service isn't my own, we shipped the kodi package with it a few years back.  See this commit.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#16 2016-12-06 00:39:50

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Why does the modesetting driver need root

graysky wrote:

The requirements for this are:

* [[systemd]]; version >=216 for multiple instances

The point here is logind. You don't get that with the service.

Online

Board footer

Powered by FluxBB