Bug 618384 - sandbox returns "execv: No such file or directory"
Summary: sandbox returns "execv: No such file or directory"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 13
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-26 19:45 UTC by Justin Keogh
Modified: 2013-01-10 06:05 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.7.19-44.fc13
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-10 21:41:59 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Justin Keogh 2010-07-26 19:45:02 UTC
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 21:03:21 UTC
Are you seeing AVC messages?

Comment 2 Justin Keogh 2010-07-27 01:00:10 UTC
No, and if I launch the SELinux Troubleshooter it is empty "No alerts to view".

Comment 3 Daniel Walsh 2010-07-27 13:31:48 UTC
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 18:02:05 UTC
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 18:05:39 UTC
What is the path to your homedir?

Comment 6 Justin Keogh 2010-07-27 18:12:20 UTC
[default@localhost ~]$ readlink -f ~
/home/default

Comment 7 Daniel Walsh 2010-07-27 20:39:00 UTC
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-28 02:16:23 UTC
No, my homedir really is /home/default

[default@localhost ~]$ ls /home
default
[default@localhost ~]$

Comment 9 Daniel Walsh 2010-07-28 14:38:33 UTC
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 16:39:39 UTC
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 16:52:57 UTC
Does 

sandbox -X xterm 

Work?

Comment 12 Daniel Walsh 2010-07-28 16:55:38 UTC
Justin if you have access to IRC,  ping dwalsh on freenode - #selinux

Comment 13 Justin Keogh 2010-08-03 01:05:21 UTC
after installing xterm:

[default@localhost ~]$ sandbox -X xterm
execv: No such file or directory

Comment 14 Justin Keogh 2010-08-03 01:08:37 UTC
Re: freenode, in #selinux now nick jakeogh

Comment 15 Daniel Walsh 2010-08-03 13:46:23 UTC
Is policycoreutils-sandbox installed?

Comment 16 Justin Keogh 2010-08-03 14:25:57 UTC
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 15:31:22 UTC
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 17:21:45 UTC
Miroslav we need to add execstack to sandbox_xserver_t

Comment 19 Miroslav Grepl 2010-08-04 14:20:35 UTC
Fixed in selinux-policy-3.7.19-43.fc13.noarch.

Comment 20 Fedora Update System 2010-08-06 13:41:57 UTC
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 21:01:08 UTC
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 21:40:23 UTC
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.