Bug 673224 - Sandboxes don't start after recent upgrade
Summary: Sandboxes don't start after recent upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy-targeted
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-27 18:34 UTC by Amit Shah
Modified: 2011-02-18 20:24 UTC (History)
5 users (show)

Fixed In Version: selinux-policy-3.9.7-28.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-02-03 20:26:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
strace output (382.65 KB, text/plain)
2011-01-27 18:34 UTC, Amit Shah
no flags Details

Description Amit Shah 2011-01-27 18:34:55 UTC
Created attachment 475663 [details]
strace output

Description of problem:
After doing a system update today, sandboxes (at least for sandbox_web_t) don't start.  A window shows up and immediately closes.  There is no security alert.  I'm attaching the strace output.

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.9.7-25.fc14.noarch

Comment 1 Daniel Walsh 2011-01-27 21:08:17 UTC
Are you seeing any AVC message?

Does 

sandbox -X xterm

work?

Comment 2 Amit Shah 2011-01-28 02:55:21 UTC
$ sandbox -X xterm
Failed to start message bus: Failed to open "/etc/selinux/targeted/contexts/dbus_contexts": Permission denied
EOF in dbus-launch reading address from bus daemon
Hangup

I see the following in /var/log/messages:

Jan 28 08:19:14 amit-x200 setroubleshoot: [root.ERROR] Could not open log file (/var/log/setroubleshoot/setroubleshootd.log) - using stderr
Jan 28 08:19:14 amit-x200 setroubleshoot: [Errno 13] Permission denied: '/var/run/setroubleshootd.pid'


Jan 28 08:15:26 amit-x200 setroubleshoot: [dbus.proxies.ERROR] Introspect error on :1.48:/org/fedoraproject/Setroubleshootd: dbus.exceptions.DBusException: o
rg.freedesktop.DBus.Error.NoReply: Message did not receive a reply (timeout by message bus)
Jan 28 08:15:26 amit-x200 setroubleshoot: [dbus.ERROR] could not start dbus: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.48 was not provided by an
y .service files
Jan 28 08:15:31 amit-x200 dbus: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.63" (uid=500 pid=1884 comm="nautilus) interfa
ce="org.freedesktop.DBus.Properties" member="GetAll" error name="(unset)" requested_reply=0 destination=":1.14" (uid=0 pid=1540 comm="/usr/sbin/console-kit-d
aemon))

A bunch of messages from earlier:

Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/resolv.co
nf. For complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the netlink_route_soc
ket Unknown. For complete SELinux messages. run sealert -l 3ff75947-5394-4137-a7a3-03a1c89afe34
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the netlink_route_soc
ket Unknown. For complete SELinux messages. run sealert -l 3ff75947-5394-4137-a7a3-03a1c89afe34
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from connectto access on the unix_stream_so
cket @/tmp/.X11-unix/X0. For complete SELinux messages. run sealert -l 3caf736b-9ca7-43b0-9732-ea58f4053b70
Jan 27 23:49:37 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the netlink_route_soc
ket Unknown. For complete SELinux messages. run sealert -l 3ff75947-5394-4137-a7a3-03a1c89afe34
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the netlink_route_soc
ket Unknown. For complete SELinux messages. run sealert -l 3ff75947-5394-4137-a7a3-03a1c89afe34
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the netlink_route_soc
ket Unknown. For complete SELinux messages. run sealert -l 3ff75947-5394-4137-a7a3-03a1c89afe34
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from open access on the file /etc/hosts. Fo
r complete SELinux messages. run sealert -l baac3351-b971-4570-ad7f-3826e3ba964d
Jan 27 23:49:38 amit-x200 setroubleshoot: SELinux is preventing /usr/lib64/xulrunner-1.9.2/mozilla-xremote-client from create access on the udp_socket port N
one. For complete SELinux messages. run sealert -l 845ff1a9-f82a-42cc-86b6-ebd1a9d39249


On clicking the desktop sealert icon, I didn't get any window, but on manually running sealert, I get some AVCs.  Pasting one of them (all of these correspond to the times above in /var/log/messages for firefox).

SELinux is preventing /usr/lib64/nspluginwrapper/plugin-config from using the setgid capability.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that plugin-config should have the setgid capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep plugin-config /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:sandbox_t:s0:c42,c409
Target Context                unconfined_u:unconfined_r:sandbox_t:s0:c42,c409
Target Objects                Unknown [ capability ]
Source                        plugin-config
Source Path                   /usr/lib64/nspluginwrapper/plugin-config
Port                          <Unknown>
Host                          amit-x200.redhat.com
Source RPM Packages           nspluginwrapper-1.3.0-15.fc14
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.7-25.fc14
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     amit-x200.redhat.com
Platform                      Linux amit-x200.redhat.com
                              2.6.35.10-74.fc14.x86_64 #1 SMP Thu Dec 23
                              16:04:50 UTC 2010 x86_64 x86_64
Alert Count                   4
First Seen                    Thu 27 Jan 2011 11:49:31 PM IST
Last Seen                     Thu 27 Jan 2011 11:49:33 PM IST
Local ID                      147a2e16-42b4-48a8-af8c-f04ce085aa08

Raw Audit Messages
type=AVC msg=audit(1296152373.153:88): avc:  denied  { setgid } for  pid=4316 comm="plugin-config" capability=6  scontext=unconfined_u:unconfined_r:sandbox_t:s0:c42,c409 tcontext=unconfined_u:unconfined_r:sandbox_t:s0:c42,c409 tclass=capability


type=SYSCALL msg=audit(1296152373.153:88): arch=x86_64 syscall=setgid success=yes exit=0 a0=1f5 a1=3bcd19f1c0 a2=1 a3=7fd5557199f0 items=0 ppid=4250 pid=4316 auid=500 uid=500 gid=501 euid=0 suid=0 fsuid=0 egid=501 sgid=501 fsgid=501 tty=pts1 ses=1 comm=plugin-config exe=/usr/lib64/nspluginwrapper/plugin-config subj=unconfined_u:unconfined_r:sandbox_t:s0:c42,c409 key=(null)

Hash: plugin-config,sandbox_t,sandbox_t,capability,setgid

audit2allow

#============= sandbox_t ==============
allow sandbox_t self:capability setgid;

audit2allow -R

#============= sandbox_t ==============
allow sandbox_t self:capability setgid;

Comment 3 Mads Kiilerich 2011-02-01 19:50:55 UTC
I get the dbus_contexts Permission denied error too. This system has been upgraded several times and is now at F14 with updates. I just relabelled the system and created a new user.

[user@local ~]$ sandbox -X firefox
Failed to start message bus: Failed to open "/etc/selinux/targeted/contexts/dbus_contexts": Permission denied
EOF in dbus-launch reading address from bus daemon
Hangup

- but no SE messages or other syslog messages.

Strace on the sandbox command shows something that might be relevant:
...
[pid  2393] execve("/usr/sbin/seunshare", ["/usr/sbin/seunshare", "-Z", "unconfined_u:unconfined_r:sandbox_x_t:s0:c285,c397", "-t", "/tmp/.sandboxbEz9qw", "-h", "/home/user/.sandbox/.sandboxa9GtmT", "--", "/usr/share/sandbox/sandboxX.sh", "1000x700"], [/* 46 vars */] <unfinished ...>
...
[pid  2393] unshare(CLONE_NEWNS)        = -1 EPERM (Operation not permitted)
[pid  2393] dup(2)                      = 3
[pid  2393] fcntl64(3, F_GETFL)         = 0x8001 (flags O_WRONLY|O_LARGEFILE)
[pid  2393] close(3)                    = 0
[pid  2393] write(2, "Failed to unshare: Operation not permitted\n", 43Failed to unshare: Operation not permitted
) = 43
[pid  2393] exit_group(-1)              = ?
...

So there was a helpful error message but it was lost somewhere. Too bad.

unshare requires CAP_SYS_ADMIN, but it is suid root so I would expect it got the capability that way?

-rwsr-xr-x. root root system_u:object_r:seunshare_exec_t:s0 /usr/sbin/seunshare

Comment 4 Miroslav Grepl 2011-02-02 11:17:15 UTC
I have found a bug. 

Amit, Mads,
thanks for that.

Could you use the RPM from koji for now

http://koji.fedoraproject.org/koji/buildinfo?buildID=216612

I am going to submit a new update today.

Comment 5 Amit Shah 2011-02-02 12:32:56 UTC
That update works for me.

Thanks!

Comment 6 Mads Kiilerich 2011-02-02 12:52:32 UTC
Thanks.

It works better for me, but now firefox crashes. See bug 674545 with SE messages in attachment 476560 [details].

Comment 7 Fedora Update System 2011-02-02 13:08:41 UTC
selinux-policy-3.9.7-28.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-28.fc14

Comment 8 Miroslav Grepl 2011-02-02 13:10:35 UTC
Mads,
does 

sandbox -X -t sandbox_web_t firefox

work for you?

Comment 9 Miroslav Grepl 2011-02-02 13:11:40 UTC
Amit,
could you update the karma?

Comment 10 Daniel Walsh 2011-02-02 13:21:31 UTC
sandbox -X firefox 

will blow up because the standard SELinux type does not allow connections to http ports, and I guess firefox does not handle this well.

Using sandbox_web_t for the type should allow the access.

Comment 11 Mads Kiilerich 2011-02-02 14:13:53 UTC
Yes, thanks, firefox and sandbox_web_t seems to work for me on one machine. Konqueror fails nicely with the default type, while firefox crashes as reported on bug 674545.

On another machine it fails creating .sandboxXXX. It might be related to bug 674548, but I don't think I can report success yet.

Comment 12 Fedora Update System 2011-02-02 19:31:36 UTC
selinux-policy-3.9.7-28.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update selinux-policy'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/selinux-policy-3.9.7-28.fc14

Comment 13 Fedora Update System 2011-02-03 20:25:45 UTC
selinux-policy-3.9.7-28.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 GV 2011-02-15 08:10:12 UTC
Still does not work for me. selinux-policy is version 3.9.7-29.
Nothing in /var/log/audit/audit.log. Nothing in /var/log/messages.

# sandbox -X xterm
Failed to start message bus: Failed to open "/etc/selinux/targeted/contexts/dbus_contexts": Permission denied
EOF in dbus-launch reading address from bus daemon
Hangup

Comment 15 Miroslav Grepl 2011-02-15 12:07:49 UTC
It works for me. 

Could you try to reinstall policy and make sure nothing complains on reinstall.

Comment 16 GV 2011-02-15 12:42:18 UTC
(In reply to comment #15)
> It works for me. 
Well, I'm here because it not works for me!

> Could you try to reinstall policy and make sure nothing complains on reinstall.
# yum reinstall selinux-policy-3.9.7-29.fc14.noarch selinux-policy-targeted-3.9.7-29.fc14.noarch
....
-----------------------------------------------------------------------------------------------------------------------
Total                                                                                  720 kB/s | 3.1 MB     00:04     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : selinux-policy-3.9.7-29.fc14.noarch                                                             1/2 
  Installing     : selinux-policy-targeted-3.9.7-29.fc14.noarch                                                    2/2 
yum-updatesd not on the bus

Installed:
  selinux-policy.noarch 0:3.9.7-29.fc14                 selinux-policy-targeted.noarch 0:3.9.7-29.fc14                

Complete!

/var/log/messages:
Feb 15 14:31:06 xxx yum[9462]: Installed: selinux-policy-3.9.7-29.fc14.noarch
Feb 15 14:32:49 xxx dbus: avc:  received policyload notice (seqno=2)
Feb 15 14:32:49 xxx dbus: avc:  received policyload notice (seqno=2)
Feb 15 14:32:53 xxx dbus: [system] Reloaded configuration
Feb 15 14:33:34 xxx yum[9462]: Installed: selinux-policy-targeted-3.9.7-29.fc14.noarch

Nothing relevant in /var/log/audit/audit.log

# sandbox -X xterm
Failed to start message bus: Failed to open "/etc/selinux/targeted/contexts/dbus_contexts": Permission denied
EOF in dbus-launch reading address from bus daemon
Hangup

Comment 17 GV 2011-02-15 17:00:36 UTC
I temporary disabled selinux (setenforce 0) and start again sandbox -X xterm. This time sandbox start xterm but I have some denials in /var/log/audit/audit.log (but not when selinux is enforced):

type=AVC msg=audit(1297788999.742:203): avc:  denied  { read } for  pid=3961 comm="dbus-daemon" name="dbus_contexts" dev=sda5 ino=70403014 scontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tcontext=system_u:object_r:default_context_t:s0 tclass=file
type=AVC msg=audit(1297788999.742:203): avc:  denied  { open } for  pid=3961 comm="dbus-daemon" name="dbus_contexts" dev=sda5 ino=70403014 scontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tcontext=system_u:object_r:default_context_t:s0 tclass=file
type=AVC msg=audit(1297788999.742:204): avc:  denied  { getattr } for  pid=3961 comm="dbus-daemon" path="/etc/selinux/targeted/contexts/dbus_contexts" dev=sda5 ino=70403014 scontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tcontext=system_u:object_r:default_context_t:s0 tclass=file
type=AVC msg=audit(1297788999.745:205): avc:  denied  { create } for  pid=3963 comm="dbus-daemon" scontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tcontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tclass=netlink_selinux_socket
type=AVC msg=audit(1297788999.746:206): avc:  denied  { bind } for  pid=3963 comm="dbus-daemon" scontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tcontext=unconfined_u:unconfined_r:sandbox_x_t:s0:c203,c398 tclass=netlink_selinux_socket

Comment 18 Miroslav Grepl 2011-02-15 21:52:01 UTC
Gabriel,
could you add output of

# id -Z

Also could you try to execute

# yum reinstall policycoreutils-sandbox

Has it ever worked for you?

Comment 19 GV 2011-02-15 22:23:14 UTC
(In reply to comment #18)

> # id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

> Has it ever worked for you?
sandbox -X ? 
No. I tried first time around 20-21 january 2011 and did not work. I did not have time until now to investigate the problem.

Comment 20 Miroslav Grepl 2011-02-15 22:29:14 UTC
(In reply to comment #19)
> (In reply to comment #18)
> 
> > # id -Z
> unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
> 

Oops, I meant 

# id

Comment 21 GV 2011-02-15 22:40:21 UTC
(In reply to comment #20)

> # id
uid=500(xxxx) gid=500(xxxx) groups=500(xxxx),10(wheel),501(vboxusers) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

Comment 22 Mads Kiilerich 2011-02-16 14:09:45 UTC
A full relabeling might have made a difference for me.

Perhaps something like "restorecon -Rvn /" will report something interesting.

Comment 23 Daniel Walsh 2011-02-16 20:01:32 UTC
Gabriel VLASIU and I worked on this via IRC, and we found that his sandbox would not work until we allowed them to read the default_context file.

Comment 24 Miroslav Grepl 2011-02-17 08:38:50 UTC
Ok, added to selinux-policy-3.9.7-31.fc14

Comment 25 Daniel Walsh 2011-02-17 19:19:16 UTC
Could you grab the latest sandbox policy from Rawhide and back port it to F13 and F14.

Comment 26 Miroslav Grepl 2011-02-17 20:32:30 UTC
Changes should be in the latest F13 and F14 policy. 

Gabriel, you can test the policy from koji for now

http://koji.fedoraproject.org/koji/buildinfo?buildID=229190

Comment 27 GV 2011-02-18 08:03:17 UTC
(In reply to comment #26)
> Changes should be in the latest F13 and F14 policy. 
> 
> Gabriel, you can test the policy from koji for now
> 
> http://koji.fedoraproject.org/koji/buildinfo?buildID=229190
sandbox -X xterm works fine.
sandbox -X -t sandbox_web_t firefox does not start.
type=AVC msg=audit(1298008831.201:60): avc:  denied  { read } for  pid=2413 comm="sandboxX.sh" path="/home/gabriel/GNUstep/Defaults" dev=loop0 ino=140 scontext=unconfined_u:unconfined_r:sandbox_web_t:s0:c19,c51 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=dir
type=AVC msg=audit(1298008831.857:61): avc:  denied  { create } for  pid=2435 comm="dbus-daemon" scontext=unconfined_u:unconfined_r:sandbox_web_t:s0:c19,c51 tcontext=unconfined_u:unconfined_r:sandbox_web_t:s0:c19,c51 tclass=netlink_selinux_socket
type=AVC msg=audit(1298008832.031:62): avc:  denied  { execute_no_trans } for  pid=2431 comm="xulrunner" path="/usr/lib64/xulrunner-2/xulrunner" dev=sda2 ino=1692707 scontext=unconfined_u:unconfined_r:sandbox_web_t:s0:c19,c51 tcontext=system_u:object_r:lib_t:s0 tclass=file

Comment 28 Daniel Walsh 2011-02-18 14:43:22 UTC
restorecon -R -v /usr/lib64/xulrunner-2/xulrunner
matchpathcon /usr/lib64/xulrunner-2/xulrunner
/usr/lib64/xulrunner-2/xulrunner	system_u:object_r:bin_t:s0

The other one looks like it might be a leak.

Comment 29 Miroslav Grepl 2011-02-18 14:47:13 UTC
Actually I need to fix the labeling

# matchpathcon /usr/lib64/xulrunner-2/xulrunner
/usr/lib64/xulrunner-2/xulrunner	system_u:object_r:lib_t:s0

on F13, F14.

So try to test it using

chcon -t bin_t /usr/lib64/xulrunner-2/xulrunner

Comment 30 GV 2011-02-18 15:30:45 UTC
(In reply to comment #29)
> Actually I need to fix the labeling
> 
> # matchpathcon /usr/lib64/xulrunner-2/xulrunner
> /usr/lib64/xulrunner-2/xulrunner system_u:object_r:lib_t:s0
> 
> on F13, F14.
> 
> So try to test it using
> 
> chcon -t bin_t /usr/lib64/xulrunner-2/xulrunner
# ls -lZ /usr/lib64/xulrunner-2/xulrunner
-rwxr-xr-x. root root system_u:object_r:bin_t:s0       /usr/lib64/xulrunner-2/xulrunner

type=AVC msg=audit(1298035763.595:21): avc:  denied  { execute_no_trans } for  pid=1217 comm="run-mozilla.sh" path="/usr/lib64/xulrunner-2/xulrunner-bin" dev=sda2 ino=1692708 scontext=unconfined_u:unconfined_r:sandbox_web_t:s0:c365,c993 tcontext=system_u:object_r:lib_t:s0 tclass=file
type=SYSCALL msg=audit(1298035763.595:21): arch=c000003e syscall=59 success=no exit=-13 a0=21b8ae0 a1=21c3f00 a2=21c3360 a3=7fff3c9cac60 items=0 ppid=1213 pid=1217 auid=500 uid=500 gid=500 euid=500 suid=500 fsuid=500 egid=500 sgid=500 fsgid=500 tty=(none) ses=1 comm="run-mozilla.sh" exe="/bin/bash" subj=unconfined_u:unconfined_r:sandbox_web_t:s0:c365,c993 key=(null)

Comment 31 GV 2011-02-18 16:41:51 UTC
The problem is not the policy (I generated one via audit2allow in a hurry
available at https://www.vlasiu.net/selinux/sandboxI.te).

The real problem is the reboot.

I'm not longer able to umount /home and /tmp partition anymore if I run sandbox
-X multiple times. During creation of sandboxI.te I had to reboot my computer 
via power button and not once or twice.

My /home and /tmp is an encrypted loop-AES partition. Nothing special about the
kernel, is fedora's (latest) kernel with a custom loop module.
/tmp partition is automaticaly formated and mounted with a key valid until I
reboot (I hacked a bit rc.sysinit). Also rc.sysinit ask me if I want to mount 
/home partition (noauto in /etc/fstab). If I say yes, I provide the password,
partition is mounted.
An then /etc/init.d/sandbox start ( iactivated this service recently) to test
the sandbox -X firefox.

If I run sandbox - I dont know - 10-15 times the seunshare become crazy. Sometimes 
it's keep the processor up to 100% for more than 10 minutes. Then hald take the
same path as seunshare. Is't running for minutes with cpu at 100%.

Then this happen I'm not able to reboot since netfs is trying to unmount 
loop-aes mounted partitons and the unmount get stuck. Once, before reboot, I did
a lsof -b and it's keep shoing on screen something like this:

lsof: WARNING: can't stat() xfs file system /home/gabriel
      Output information may be incomplete.
lsof: avoiding readlink(/home/gabriel): -b was specified.
lsof: avoiding stat(/home/gabriel): -b was specified.
lsof: WARNING: can't stat() xfs file system /home/gabriel
      Output information may be incomplete.
lsof: avoiding readlink(/tmp): -b was specified.
lsof: avoiding stat(/tmp): -b was specified.
lsof: WARNING: can't stat() xfs file system /tmp
      Output information may be incomplete.

I't going to say this over and over again.... and never exit.
Power button is required.

Now, today I seen something really strange. If I do not mount the /home 
partition at startup - ok, I do not provide a password so it's not going to be
mounted - then /etc/init.d/sandbox start and is asking-me for /home partition
password. I provide the password and sandbox start. Now...

# ls -l /home
#
Nothing. Strange.

# mount
/home on /home type none (rw,bind)
?????

# /etc/init.d/sandbox stop
Stopping sandbox                                           [  OK  ]

# mount
/home on /home type none (rw,bind)
????????

# losetup -a
/dev/loop0: [0005]:5503 (/dev/sda6) offset=8192 encryption=AES256 multi-key-v3
/dev/loop6: [0005]:5502 (/dev/sda5) encryption=AES256 multi-key-v3
loop0 - /home
loop6 - /tmp

# umount /home
# mount | grep home
# /etc/init.d/sandbox start
Starting sandbox                                           [FAILED]

So I think the two issues here are related. For now on until become clear what's
going on I'm only to test this in a virtual computer.
What exactly /etc/init.d/sandbox does?

Comment 32 Daniel Walsh 2011-02-18 20:24:22 UTC
One thing you might want to try, remove the sandbox init script.  It is not needed anymore, I believe,  It is only needed for pam_namespace/xguest, which you are probably not using.  There is an open bug on pam_namespace to remove the requirement for this script altogether.


Note You need to log in before you can comment on or make changes to this bug.