Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rootless xorg support #246

Closed
jleclanche opened this issue Aug 2, 2014 · 29 comments · Fixed by #1371
Closed

Fix rootless xorg support #246

jleclanche opened this issue Aug 2, 2014 · 29 comments · Fixed by #1371
Assignees

Comments

@jleclanche
Copy link
Member

[10:48:14] <AnAkkk> after this change in the Xorg 1.16 arch package, SDDM no longer works correctly because at the time that X starts, it can't find the nvidia module https://bugs.archlinux.org/task/41259
[10:48:19] <AnAkkk> is that something we need to fix in sddm?
[10:48:44] <AnAkkk> I have to restart sddm with systemctl every time to make it work
[11:07:08] <AnAkkk> ok, actually it's related to the dkms systemd service + nvidia-dkms
[11:07:18] <AnAkkk> that I use to rebuild the nvidia module on kernel updates
[11:07:38] <AnAkkk> it seems to unload the nvidia module, X can't find it
@AnAkkk
Copy link

AnAkkk commented Aug 2, 2014

Ignore my messages, they actually fixed that in the archlinux xorg package, and they were unrelated to rootless xorg.
SDDM still needs support for that though, otherwise X is still ran as root.

@jleclanche
Copy link
Member Author

Ok.

@bchretien
Copy link
Contributor

👍 for rootless Xorg support (most Arch users would probably agree after the last Xorg update).

@jleclanche
Copy link
Member Author

@plfiorini Was there any progress on this?

@tugit
Copy link

tugit commented Nov 4, 2015

Debian testing allows running x without root, see https://www.phoronix.com/scan.php?page=news_item&px=Debian-Non-Root-X
I can start my Plasma 5 session by switching to a VT and type startx, then indeed X runs as the logged in user on the VT. When using sddm to login, X runs with root privileges.
Any progress ahead?

@xiangzhai
Copy link

oh yup #492

@jleclanche jleclanche added this to the 1.0 milestone Nov 5, 2015
@tugit
Copy link

tugit commented Nov 5, 2015

With major distributions supporting running x without root (fedora, arch, debian -> ubuntu) I consider it a security risk to run something as root when it does not have to.

Related discussion in case of lightdm: https://bugs.launchpad.net/lightdm/+bug/1292324

@jleclanche
Copy link
Member Author

PRs welcome.

@plfiorini plfiorini modified the milestones: 0.14, 1.0 Nov 6, 2015
@plfiorini
Copy link
Member

Let's try to do this for 0.14, we have ~2 months to do so.

@plfiorini plfiorini self-assigned this Nov 6, 2015
@plfiorini
Copy link
Member

Information:

@plfiorini plfiorini modified the milestones: 0.15, 0.14 Apr 5, 2016
@kugel-
Copy link

kugel- commented Jul 25, 2016

Is anyone working on this?

@plfiorini
Copy link
Member

Not currently

@plfiorini
Copy link
Member

@kugel- started working, see PR #673

@HunterGraubard
Copy link

I'd just like to chime in with my support for this feature. For me, SDDM is completely unusable without this, as running Xorg as root is entirely unacceptable for me due to the security implications. I hope this gets implemented quickly.

GDM has been able to do this for quite some time, and I believe it goes a step further by not just running Xorg with lower privileges, but also running most of its own code with lower privileges under a custom "gdm" user.

Thanks for your work.

@fabiscafe
Copy link

I'm also still waiting for rootless X with sddm.

@plfiorini plfiorini modified the milestones: 0.16, 0.15 Apr 19, 2017
@aufkrawall
Copy link

It's extremely disappointing that this is still open, please don't release 0.16 without it.

@jleclanche
Copy link
Member Author

PRs welcome but this isnt exactly a blocking issue for minor releases.

@plfiorini plfiorini removed this from the 0.16 milestone Nov 20, 2017
@sten0
Copy link

sten0 commented Dec 12, 2017

Thank you for maintaining SDDM :-) Would it be possible to solve this by July 2018?

@liefswanson
Copy link

liefswanson commented Oct 31, 2018

This isn't just theoretically a security risk... X can overwrite the passwords file by tricky use of log file location... I don't think it is worth it to have X running as root when this exploit is well known.

This should be bumped way up the priority list.

@aufkrawall
Copy link

Afair last two vulnerabilities were prevented by rootless xorg, SDDM puts users at unnecessary risk.

@StefanBruens
Copy link

Posting "me too" comments will not make it happen. On the contrary, it wastes developer time.

If you really need it, consider contracting someone who does the work. As said several times, PRs welcome!

@Rihannakitten
Copy link

PRs

#673

@bionade24
Copy link

How is the progress at the moment? What has to be done?

@devurandom
Copy link

Once you start X as user and want to get logind integration for it, you will need to pass it -keeptty.

See-Also: https://bugs.gentoo.org/603294

@yan12125
Copy link

yan12125 commented May 9, 2020

Any updates? I tried the following two branches and neither works :/

[General]
DisplayServer = x11-user

However, sddm does not start. According to strace, Xorg.wrap reports "Only console users are allowed to run the X server". Seems Xorg check if one of stdin/stdout/stderr is /dev/ttyX [1], while strace tells me that all 3 file descriptors are FIFOs when Xorg.wrap is invoked.

Environment: Arch Linux up-to-date

[1] https://gitlab.freedesktop.org/xorg/xserver/-/blob/xorg-server-1.20.8/hw/xfree86/xorg-wrapper.c#L171

@Kodehawa
Copy link

Kodehawa commented Nov 4, 2020

Any news on this?

@bionade24
Copy link

Any news on this?

Afaik even gdm needs to be root for certain tasks and then downgrades itself. So it's not really easy to accomplish.
No one wants to work on the X server anymore, focussing on wayland is more important. https://www.phoronix.com/scan.php?page=news_item&px=XServer-Abandonware<

SDDM seems to support this behaviour (from the README):

SDDM runs the greeter as a system user named "sddm" whose home directory needs to be set to /var/lib/sddm.

Maybe just you distro maintainer never tried this because it's more pain than gain, in the Arch IRC channels there are various poeple trying to rootless gdm work and fails for couple of reasonsons.

I guess this never will work perfectly because it' s using a piece of software made for big UNIX 36 years ago. Wayland support is more important, I hope.

@kugel-
Copy link

kugel- commented Nov 4, 2020

Whether SDDM/GDM itself runs as root or not is a separate issue. This issue is about rootless X which is a subordinary process.

@Kodehawa
Copy link

Any news on this?

Afaik even gdm needs to be root for certain tasks and then downgrades itself. So it's not really easy to accomplish.
No one wants to work on the X server anymore, focussing on wayland is more important. https://www.phoronix.com/scan.php?page=news_item&px=XServer-Abandonware<

SDDM seems to support this behaviour (from the README):

SDDM runs the greeter as a system user named "sddm" whose home directory needs to be set to /var/lib/sddm.

Maybe just you distro maintainer never tried this because it's more pain than gain, in the Arch IRC channels there are various poeple trying to rootless gdm work and fails for couple of reasonsons.

I guess this never will work perfectly because it' s using a piece of software made for big UNIX 36 years ago. Wayland support is more important, I hope.

Whether wayland is more important or not is not the focus on this. Rootless X has been available for years, and it's not about the greeter running as root or not, it's about X itself (Xorg) running as a normal user instead of root.

aleixpol pushed a commit to aleixpol/sddm that referenced this issue Feb 18, 2021
We want to support Xorg user session and keep running it as root as an
option, so we don't break the workflow of some users.

As a matter of fact, when we run the X11 server as sddm user, we also
start the display start and stop scripts as user.  Scripts that need
root privileges won't work.

To support both modes, we move the code to sddm-x11-helper and either
run it as root or sddm user using sddm-helper.

Closes: sddm#246
plfiorini added a commit that referenced this issue Apr 19, 2021
Introduce an alternative display server option to run the greeter with
the X11 server as an unprivileged user.

Root privileges are required by default, but this will change in the
future.

Greeter output is forwarded to the helper process, instead of saving it
into a separate file like user sessions do.
This means the greeter output is available in the journal with the
daemon and helper logs.

Display start and stop commands are executed as sddm user and this might
break the workflow of our users.
That is the reason why we still run Xorg as root for the greeter by
default.

X11 user session always spawn a new display server without root
privileges.

Closes: #246
@plfiorini plfiorini reopened this Apr 26, 2021
peremen pushed a commit to peremen/sddm that referenced this issue Jun 30, 2022
Introduce an alternative display server option to run the greeter with
the X11 server as an unprivileged user.

Root privileges are required by default, but this will change in the
future.

Greeter output is forwarded to the helper process, instead of saving it
into a separate file like user sessions do.
This means the greeter output is available in the journal with the
daemon and helper logs.

Display start and stop commands are executed as sddm user and this might
break the workflow of our users.
That is the reason why we still run Xorg as root for the greeter by
default.

X11 user session always spawn a new display server without root
privileges.

Closes: sddm#246
githubkusi pushed a commit to githubkusi/sddm that referenced this issue Jul 6, 2023
Introduce an alternative display server option to run the greeter with
the X11 server as an unprivileged user.

Root privileges are required by default, but this will change in the
future.

Greeter output is forwarded to the helper process, instead of saving it
into a separate file like user sessions do.
This means the greeter output is available in the journal with the
daemon and helper logs.

Display start and stop commands are executed as sddm user and this might
break the workflow of our users.
That is the reason why we still run Xorg as root for the greeter by
default.

X11 user session always spawn a new display server without root
privileges.

Closes: sddm#246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.