[GH-ISSUE #1405] Firejail X11 sandboxing unusable with latest xpra #960

Closed
opened 2026-05-05 07:13:19 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @chiraag-nataraj on GitHub (Jul 26, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1405

Piggybacking off of #1016, but now I'm seeing this with every program. It got so bad that I had to write a wrapper script as follows:

#!/bin/sh

DISP="$1"
COM="$2"

xpra start $DISP --start-child="$COM" --exit-with-children=yes;
xpra attach $DISP &

I'm using xpra v2.1-r16505.

Originally created by @chiraag-nataraj on GitHub (Jul 26, 2017). Original GitHub issue: https://github.com/netblue30/firejail/issues/1405 Piggybacking off of #1016, but now I'm seeing this with every program. It got so bad that I had to write a wrapper script as follows: ```` #!/bin/sh DISP="$1" COM="$2" xpra start $DISP --start-child="$COM" --exit-with-children=yes; xpra attach $DISP & ```` I'm using xpra v2.1-r16505.
Author
Owner

@chiraag-nataraj commented on GitHub (Jul 28, 2017):

With newer xpra versions, 5 seconds isn't enough delay (at least on my system) - not sure why exactly. Neither is waiting for /tmp/.X11-unix/<display>. Here is a sample log:

X.Org X Server 1.19.3
Release Date: 2017-03-15
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.9.0-3-amd64 x86_64 Debian
Current Operating System: Linux chiraag 4.11.11-chiraag #4 SMP PREEMPT Thu Jul 20 00:00:32 EDT 2017 x86_64
Kernel command line: initrd=\33ef9f252dda82b147eebe6f5324ddb4\4.11.11-chiraag\initrd root=/dev/mapper/Crypto-Root ro quiet
Build Date: 07 July 2017  06:22:09AM
xorg-server 2:1.19.3-2 (https://www.debian.org/support) 
Current version of pixman: 0.34.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: "/run/user/1000/xpra/Xorg.:212.log", Time: Fri Jul 28 16:34:27 2017
(++) Using config file: "/etc/xpra/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"

Xpra server pid 4338, xpra client pid 4383, jail 4384
*** Attaching to xpra display 212 ***

Reading profile /home/chiraag/.config/firejail/x-terminal-emulator.profile
Parent pid 4384, child pid 4385
Child process initialized in 26.27 ms
urxvt: can't open display :212, aborting.

Parent is shutting down, bye...
2017-07-28 16:34:30,312 Xpra gtk2 client version 2.1-r16525 64-bit
2017-07-28 16:34:30,312  running on Linux Debian unstable sid
InitException: cannot find any live servers to connect to
xpra initialization error:
 cannot find any live servers to connect to
/home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename
2017-07-28 16:34:31,777 created unix domain socket: /run/user/1000/xpra/chiraag-212
2017-07-28 16:34:31,778 created unix domain socket: /home/chiraag/.xpra/chiraag-212
2017-07-28 16:34:31,778 created unix domain socket: /run/xpra/chiraag-212
2017-07-28 16:34:32,015 GStreamer version 1.12.2 for Python 2.7.13 64-bit
/home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename
2017-07-28 16:34:32,660 Warning: vendor 'Intel Open Source Technology Center' is greylisted,
2017-07-28 16:34:32,660  you may want to turn off OpenGL if you encounter bugs
2017-07-28 16:34:32,667 OpenGL_accelerate module loaded
2017-07-28 16:34:32,684 OpenGL enabled with Mesa DRI Intel(R) Haswell Mobile
InitException: cannot find any live servers to connect to
xpra initialization error:
 cannot find any live servers to connect to
/home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename
2017-07-28 16:34:33,672 ignored invalid default encoding option: h264
2017-07-28 16:34:34,345 Warning: webcam forwarding is disabled
2017-07-28 16:34:34,345  the virtual video directory '/sys/devices/virtual/video4linux' was not found
2017-07-28 16:34:34,345  make sure that the 'v4l2loopback' kernel module is installed and loaded
2017-07-28 16:34:34,345 found 0 virtual video devices for webcam forwarding
2017-07-28 16:34:35,855 GStreamer version 1.12.2 for Python 2.7.13 64-bit
2017-07-28 16:34:35,870 D-Bus notification forwarding is available
2017-07-28 16:34:35,874 xpra X11 version 2.1-r16525 64-bit
2017-07-28 16:34:35,874  uid=1000 (chiraag), gid=1000 (chiraag)
2017-07-28 16:34:35,874  running with pid 4338 on Linux Debian unstable sid
2017-07-28 16:34:35,874  connected to X11 display :212 with 24 bit colors
2017-07-28 16:34:35,965 xpra is ready.
2017-07-28 16:34:35,975 15.6GB of system memory

2017-07-28 16:34:37,816 got signal SIGTERM, exiting
2017-07-28 16:34:37,825 killing xvfb with pid 4381
2017-07-28 16:34:37,826 removing socket /run/user/1000/xpra/chiraag-212
2017-07-28 16:34:37,826 removing socket /home/chiraag/.xpra/chiraag-212
2017-07-28 16:34:37,826 removing socket /run/xpra/chiraag-212
(II) Server terminated successfully (0). Closing log file.
<!-- gh-comment-id:318755763 --> @chiraag-nataraj commented on GitHub (Jul 28, 2017): With newer xpra versions, 5 seconds isn't enough delay (at least on my system) - not sure why exactly. Neither is waiting for `/tmp/.X11-unix/<display>`. Here is a sample log: ```` X.Org X Server 1.19.3 Release Date: 2017-03-15 X Protocol Version 11, Revision 0 Build Operating System: Linux 4.9.0-3-amd64 x86_64 Debian Current Operating System: Linux chiraag 4.11.11-chiraag #4 SMP PREEMPT Thu Jul 20 00:00:32 EDT 2017 x86_64 Kernel command line: initrd=\33ef9f252dda82b147eebe6f5324ddb4\4.11.11-chiraag\initrd root=/dev/mapper/Crypto-Root ro quiet Build Date: 07 July 2017 06:22:09AM xorg-server 2:1.19.3-2 (https://www.debian.org/support) Current version of pixman: 0.34.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (++) Log file: "/run/user/1000/xpra/Xorg.:212.log", Time: Fri Jul 28 16:34:27 2017 (++) Using config file: "/etc/xpra/xorg.conf" (==) Using system config directory "/usr/share/X11/xorg.conf.d" Xpra server pid 4338, xpra client pid 4383, jail 4384 *** Attaching to xpra display 212 *** Reading profile /home/chiraag/.config/firejail/x-terminal-emulator.profile Parent pid 4384, child pid 4385 Child process initialized in 26.27 ms urxvt: can't open display :212, aborting. Parent is shutting down, bye... 2017-07-28 16:34:30,312 Xpra gtk2 client version 2.1-r16525 64-bit 2017-07-28 16:34:30,312 running on Linux Debian unstable sid InitException: cannot find any live servers to connect to xpra initialization error: cannot find any live servers to connect to /home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename 2017-07-28 16:34:31,777 created unix domain socket: /run/user/1000/xpra/chiraag-212 2017-07-28 16:34:31,778 created unix domain socket: /home/chiraag/.xpra/chiraag-212 2017-07-28 16:34:31,778 created unix domain socket: /run/xpra/chiraag-212 2017-07-28 16:34:32,015 GStreamer version 1.12.2 for Python 2.7.13 64-bit /home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename 2017-07-28 16:34:32,660 Warning: vendor 'Intel Open Source Technology Center' is greylisted, 2017-07-28 16:34:32,660 you may want to turn off OpenGL if you encounter bugs 2017-07-28 16:34:32,667 OpenGL_accelerate module loaded 2017-07-28 16:34:32,684 OpenGL enabled with Mesa DRI Intel(R) Haswell Mobile InitException: cannot find any live servers to connect to xpra initialization error: cannot find any live servers to connect to /home/chiraag/.themes/Vimix-Dark/gtk-2.0/main.rc:679: Background image options specified without filename 2017-07-28 16:34:33,672 ignored invalid default encoding option: h264 2017-07-28 16:34:34,345 Warning: webcam forwarding is disabled 2017-07-28 16:34:34,345 the virtual video directory '/sys/devices/virtual/video4linux' was not found 2017-07-28 16:34:34,345 make sure that the 'v4l2loopback' kernel module is installed and loaded 2017-07-28 16:34:34,345 found 0 virtual video devices for webcam forwarding 2017-07-28 16:34:35,855 GStreamer version 1.12.2 for Python 2.7.13 64-bit 2017-07-28 16:34:35,870 D-Bus notification forwarding is available 2017-07-28 16:34:35,874 xpra X11 version 2.1-r16525 64-bit 2017-07-28 16:34:35,874 uid=1000 (chiraag), gid=1000 (chiraag) 2017-07-28 16:34:35,874 running with pid 4338 on Linux Debian unstable sid 2017-07-28 16:34:35,874 connected to X11 display :212 with 24 bit colors 2017-07-28 16:34:35,965 xpra is ready. 2017-07-28 16:34:35,975 15.6GB of system memory 2017-07-28 16:34:37,816 got signal SIGTERM, exiting 2017-07-28 16:34:37,825 killing xvfb with pid 4381 2017-07-28 16:34:37,826 removing socket /run/user/1000/xpra/chiraag-212 2017-07-28 16:34:37,826 removing socket /home/chiraag/.xpra/chiraag-212 2017-07-28 16:34:37,826 removing socket /run/xpra/chiraag-212 (II) Server terminated successfully (0). Closing log file. ````
Author
Owner

@chiraag-nataraj commented on GitHub (Jul 30, 2017):

Wait. @netblue30, couldn't you just call xpra start --attach=yes? Then, xpra would automatically attach after initializing.

[Edit] Just tested this with the jail script I posted above and it works. The only thing is that the "Server endpoint" listed in the session info lists socket:/run/xpra/system instead of the normal display, but it seems to work as usual.

[Edit2] It seems using the --attach argument starts a proxy. I'm not entirely sure why, but hey...it works.

<!-- gh-comment-id:318873752 --> @chiraag-nataraj commented on GitHub (Jul 30, 2017): Wait. @netblue30, couldn't you just call `xpra start --attach=yes`? Then, `xpra` would automatically attach after initializing. [Edit] Just tested this with the `jail` script I posted above and it works. The only thing is that the "Server endpoint" listed in the session info lists `socket:/run/xpra/system` instead of the normal display, but it seems to work as usual. [Edit2] It seems using the `--attach` argument starts a proxy. I'm not entirely sure why, but hey...it works.
Author
Owner

@chiraag-nataraj commented on GitHub (Jul 30, 2017):

@netblue30, I took a crack at trying to implement this. I haven't done much security-focused stuff, so I'm not sure if I'm doing anything dangerous here, but this issue is fixed. As a bonus, firejail itself has to do much less monitoring since we let xpra take care of that.

<!-- gh-comment-id:318880458 --> @chiraag-nataraj commented on GitHub (Jul 30, 2017): @netblue30, I took a crack at trying to implement this. I haven't done much security-focused stuff, so I'm not sure if I'm doing anything dangerous here, but this issue is fixed. As a bonus, `firejail` itself has to do much less monitoring since we let `xpra` take care of that.
Author
Owner

@chiraag-nataraj commented on GitHub (Jul 31, 2017):

Closing for now.

<!-- gh-comment-id:319050807 --> @chiraag-nataraj commented on GitHub (Jul 31, 2017): Closing for now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#960
No description provided.