Bug 618384 - sandbox returns "execv: No such file or directory"
sandbox returns "execv: No such file or directory"
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
13
All Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-26 15:45 EDT by Justin Keogh
Modified: 2013-01-10 01:05 EST (History)
3 users (show)

See Also:
Fixed In Version: selinux-policy-3.7.19-44.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-08-10 17:41:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Justin Keogh 2010-07-26 15:45:02 EDT
Description of problem:

The command:
sandbox -X -t sandbox_web_t firefox

Returns:
execv: No such file or directory

Variations of the command produce the same result:

[default@localhost ~]$ mkdir /tmp/myweb ~/myweb
[default@localhost ~]$ sandbox -X -T /tmp/myweb -H ~/myweb -t sandbox_web_t firefox danwalsh.livejournal.com
execv: No such file or directory


Version-Release number of selected component (if applicable):
Fedora 13 /usr/bin/sandbox 

How reproducible:

Always


Steps to Reproduce:
1. Install a fresh copy of Fedora 13 x86_64

2. Open terminal as normal user and execute "sandbox -X -t sandbox_web_t firefox"


  
Actual results:

execv: No such file or directory

Expected results:

Firefox launches in a sadboxed enviroment


Additional info:
Comment 1 Daniel Walsh 2010-07-26 17:03:21 EDT
Are you seeing AVC messages?
Comment 2 Justin Keogh 2010-07-26 21:00:10 EDT
No, and if I launch the SELinux Troubleshooter it is empty "No alerts to view".
Comment 3 Daniel Walsh 2010-07-27 09:31:48 EDT
Have you rebooted the machine after the install?  Have you udpated to the latest packages.

sandbox -X requires that the file system be set up for namespacing.  Unfortunately this requires a start up script /etc/init.d/sandbox to be run at boot time
Comment 4 Justin Keogh 2010-07-27 14:02:05 EDT
Yes I rebooted, and completed "yup update".

Starting /etc/init.d/sandbox had no effect:

[default@localhost ~]$ su
Password: 
[root@localhost default]# /etc/init.d/sandbox start
[root@localhost default]# sandbox -X -t sandbox_web_t firefox
Must not be root
[root@localhost default]# exit
exit
[default@localhost ~]$ sandbox -X -t sandbox_web_t firefox
execv: No such file or directory
[default@localhost ~]$
Comment 5 Daniel Walsh 2010-07-27 14:05:39 EDT
What is the path to your homedir?
Comment 6 Justin Keogh 2010-07-27 14:12:20 EDT
[default@localhost ~]$ readlink -f ~
/home/default
Comment 7 Daniel Walsh 2010-07-27 16:39:00 EDT
Does this mean that your homedir is not /home/default but some symbolic link that points at /home/default?
Comment 8 Justin Keogh 2010-07-27 22:16:23 EDT
No, my homedir really is /home/default

[default@localhost ~]$ ls /home
default
[default@localhost ~]$
Comment 9 Daniel Walsh 2010-07-28 10:38:33 EDT
And the entry in /etc/passwd says /home/default?

sandbox is attempting to mount a file system over the existing $HOME and /tmp  If these point somewhere else, it could be a problem.

What happens when you run.

seunshare -t /tmp/myweb -h ~/myweb -Z `id -Z` -- /usr/bin/id -Z
Comment 10 Justin Keogh 2010-07-28 12:39:39 EDT
Yes,

[default@localhost ~]$ cat /etc/passwd | grep default
default:x:500:500::/home/default:/bin/bash


[default@localhost ~]$ seunshare -t /tmp/myweb -h ~/myweb -Z `id -Z` -- /usr/bin/id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[default@localhost ~]$ ls -alh /tmp/myweb/ /home/default/myweb/
/home/default/myweb/:
total 28K
drwxrwxr-x.  2 default default 4.0K Jul 26 12:22 .
drwx--x---+ 40 default users   4.0K Jul 28 08:37 ..
-rwx------.  1 default default  269 Jul 26 12:22 .sandboxrc
-rw-rw-r--.  1 default default 9.2K Jul 26 12:22 .xmodmap

/tmp/myweb/:
total 8.0K
drwxrwxr-x.  2 default default 4.0K Jul 26 12:21 .
drwxrwxrwt. 21 root    root    4.0K Jul 28 09:39 ..
Comment 11 Daniel Walsh 2010-07-28 12:52:57 EDT
Does 

sandbox -X xterm 

Work?
Comment 12 Daniel Walsh 2010-07-28 12:55:38 EDT
Justin if you have access to IRC,  ping dwalsh on freenode - #selinux
Comment 13 Justin Keogh 2010-08-02 21:05:21 EDT
after installing xterm:

[default@localhost ~]$ sandbox -X xterm
execv: No such file or directory
Comment 14 Justin Keogh 2010-08-02 21:08:37 EDT
Re: freenode, in #selinux now nick jakeogh
Comment 15 Daniel Walsh 2010-08-03 09:46:23 EDT
Is policycoreutils-sandbox installed?
Comment 16 Justin Keogh 2010-08-03 10:25:57 EDT
No it was not. Installing that fixed the problem. Now:
sandbox -X -t sandbox_web_t firefox

works. Sorry if I missed the documentation that this had to be installed.

Thanks! -Justin
Comment 17 Daniel Walsh 2010-08-03 11:31:22 EDT
Well that is actually a bug.  It should tell you to install the package.  I did not know this was happening until I tried it myself.
Comment 18 Daniel Walsh 2010-08-03 13:21:45 EDT
Miroslav we need to add execstack to sandbox_xserver_t
Comment 19 Miroslav Grepl 2010-08-04 10:20:35 EDT
Fixed in selinux-policy-3.7.19-43.fc13.noarch.
Comment 20 Fedora Update System 2010-08-06 09:41:57 EDT
selinux-policy-3.7.19-44.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-44.fc13
Comment 21 Fedora Update System 2010-08-06 17:01:08 EDT
selinux-policy-3.7.19-44.fc13 has been pushed to the Fedora 13 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: http://admin.fedoraproject.org/updates/selinux-policy-3.7.19-44.fc13
Comment 22 Fedora Update System 2010-08-10 17:40:23 EDT
selinux-policy-3.7.19-44.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

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