Bug 1960382

Summary: Can't run graphical applications in SELinux sandbox
Product: [Fedora] Fedora Reporter: Marc Muehlfeld <mmuehlfe>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: dwalsh, grepl.miroslav, lvrabec, mmalik, nknazeko, omosnace, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-22 19:31:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marc Muehlfeld 2021-05-13 18:23:30 UTC
Description of problem:
Can't run graphical applications in SELinux sandbox.


Version-Release number of selected component (if applicable):
policycoreutils-sandbox-3.2-1.fc34.x86_64
selinux-policy-sandbox-34.6-1.fc34.noarch
firefox-88.0.1-1.fc34.x86_64
cinnamon-4.8.6-5.fc34.x86_64


How reproducible:
Always


Steps to Reproduce:
$ sandbox -X -t sandbox_web_t firefox
dbus[6883]: Unable to set up transient service directory: Failed to create directory /run/user/1000/dbus-1: Permission denied

dbus-daemon[6883]: Cannot setup inotify for '/usr/share/dbus-1/session.d'; error 'Permission denied'
/usr/bin/firefox: line 196: getenforce: command not found
/usr/bin/firefox: line 196: [: !=: unary operator expected
Unable to init server: Could not connect: Connection refused
Error: cannot open display: :1


$ sandbox -X keepassxc
dbus-daemon[9291]: Cannot setup inotify for '/usr/share/dbus-1/session.d'; error 'Permission denied'
XIO:  fatal IO error 2 (No such file or directory) on X server ":1"
      after 233 requests (233 known processed) with 8 events remaining.


Some other applications show no error, but they are also not started. For example:
$ sandbox -X nemo
$ sandbox -X xreader



Additional info:
Running non-graphical applications, for example "sandbox bash", works.

Comment 1 Nikola Knazekova 2021-12-14 17:30:02 UTC
Hi Marc,

I created PR to our policy with new rules: https://github.com/fedora-selinux/selinux-policy/pull/972

And enabled these booleans:

- setsebool -P use_fusefs_home_dirs 1
- setsebool -P xserver_clients_write_xshm 1

On Fedora34 I tested: 
$ sandbox -X -t sandbox_web_t firefox
$ sandbox -X keepassxc
$ sandbox -X nemo
$ sandbox -X xreader

And all applications are working. 

Nikola

Comment 2 Zdenek Pytela 2021-12-22 19:31:53 UTC

*** This bug has been marked as a duplicate of bug 1978020 ***