Qt/KDE problems with MIT-SHM when Xorg is not running as root

Hans de Goede hdegoede at redhat.com
Thu Jan 29 01:20:41 PST 2015


Hi All,

A Fedora user has reported problems with MIT-SHM when the xserver
is not running as root. Normal use works fine, but when doing a
"su -" and then starting X apps as root MIT-SHM fails, see this
screenshot:

https://bugzilla.redhat.com/attachment.cgi?id=977933

The culprit is this error:
"Xerror: BadAccess (Attempt to access private resources denied)"

Which makes sense, the shm segment is created by the app running
as root, and the Xserver which is running as a normal user thus
cannot access it, so far this has never been a problem because
X was always running as root :)

I'm tempted to call this a feature rather then a bug, and declaring
this a Qt/KDE bug. I've written MIT SHM using X11 code in the past,
and always installed an error handler, and did an XSync after the
attach to check if the xshm-attach succeed, as it will also fail
when running over the network. I guess qt/kde is using some other
heuristic to determine if it is not running over a network, and
assumes that things will just work when not running over the
network, rather then doing "proper" error checking here.

So to me it seems that Qt/KDE should do "proper" error checking
here and simply fallback to a non shm path in this special case.

Still I thought I would send a mail to the xorg-devel list before
reporting this to the Qt guys, in case anyone has some clever
ideas how to make this work with the xserver running as a regular
user.

Regards,

Hans


p.s.

This is being tracked here for now:
https://bugzilla.redhat.com/show_bug.cgi?id=1185893


More information about the xorg-devel mailing list