Bug 470597 - xguest is preventing Firefox from starting flash plugin
Summary: xguest is preventing Firefox from starting flash plugin
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xguest
Version: 10
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-07 21:50 UTC by Joachim Katzer
Modified: 2009-12-18 06:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-18 06:47:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Joachim Katzer 2008-11-07 21:50:15 UTC
Description of problem:

Xguest in F10 Preview cannot use Flash player plugin, e.g. to view Youtube videos. Current selinux policy prevents npviewer.bin to "execstack" and plugin-config to "setuid":

node=macfed type=AVC msg=audit(1226092389.19:201): avc: denied { execstack } for pid=30575 comm="npviewer.bin" scontext=xguest_u:xguest_r:xguest_t:s0 tcontext=xguest_u:xguest_r:xguest_t:s0 tclass=process node=macfed type=SYSCALL msg=audit(1226092389.19:201): arch=40000003 syscall=125 success=no exit=-13 a0=bfe74000 a1=1000 a2=1000007 a3=fffff000 items=0 ppid=30571 pid=30575 auid=501 uid=501 gid=501 euid=501 suid=501 fsuid=501 egid=501 sgid=501 fsgid=501 tty=(none) ses=14 comm="npviewer.bin" exe="/usr/lib/nspluginwrapper/npviewer.bin" subj=xguest_u:xguest_r:xguest_t:s0 key=(null) 

node=macfed type=AVC msg=audit(1226092389.8:200): avc: denied { setuid } for pid=30575 comm="plugin-config" capability=7 scontext=xguest_u:xguest_r:xguest_t:s0 tcontext=xguest_u:xguest_r:xguest_t:s0 tclass=capability node=macfed type=SYSCALL msg=audit(1226092389.8:200): arch=40000003 syscall=213 success=yes exit=0 a0=1f5 a1=2d0ff4 a2=0 a3=bff36678 items=0 ppid=30571 pid=30575 auid=501 uid=501 gid=501 euid=501 suid=0 fsuid=501 egid=501 sgid=501 fsgid=501 tty=(none) ses=14 comm="plugin-config" exe="/usr/lib/nspluginwrapper/plugin-config" subj=xguest_u:xguest_r:xguest_t:s0 key=(null) 


Version-Release number of selected component (if applicable):

selinux-policy-3.5.13-11.fc10
xguest-1.0.6-7.fc9.noarch
nspluginwrapper-1.1.2-4.fc10
firefox-3.0.2-1.fc10.i386



How reproducible:


Steps to Reproduce:
1. Install xguest on F10 preview + flash-plugin and libflashsupport
2. Login to xguest, open Firefox and a website with a flash video.
3.
  
Actual results:
Looks for xguest as if Flash player is not installed. Normal user can view flash videos.


Expected results:
Flash should work for xguest as in F9


Additional info:
F9 not concerned.

Comment 1 Daniel Walsh 2008-11-10 16:09:12 UTC
The problem here is that firefox is not transitioning when you run it.

Does it work if you turn on the 


browser_confine_xguest boolean.

setsebool -P browser_confine_xguest 1

Comment 2 Joachim Katzer 2008-11-10 21:49:35 UTC
It was turned on.

I've tried to uninstall nspluginwrapper which I didn't use in F8 and F9. 
I assume this avoids the setuid call and complications of context transition.

But then I get the following AVC error:

node=macfed type=AVC msg=audit(1226351324.331:42): avc: denied { execstack } for pid=3237 comm="firefox" scontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tcontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tclass=process 
node=macfed type=SYSCALL msg=audit(1226351324.331:42): arch=40000003 syscall=125 success=no exit=-13 a0=bfc1d000 a1=1000 a2=1000007 a3=fffff000 items=0 ppid=3223 pid=3237 auid=501 uid=501 gid=501 euid=501 suid=501 fsuid=501 egid=501 sgid=501 fsgid=501 tty=(none) ses=1 comm="firefox" exe="/usr/lib/firefox-3.0.2/firefox" subj=xguest_u:xguest_r:xguest_mozilla_t:s0 key=(null) 

I didn't change SELinux boolean values after F10 installation. These are the current relevant settings:

$ getsebool -a | egrep '(xguest|exec|browser)'
allow_execheap --> off
allow_execmem --> off
allow_execmod --> off
allow_execstack --> on
allow_guest_exec_content --> off
allow_mplayer_execstack --> off
allow_nsplugin_execmem --> on
allow_staff_exec_content --> on
allow_sysadm_exec_content --> on
allow_unconfined_exec_content --> on
allow_user_exec_content --> on
allow_xguest_exec_content --> off
allow_xserver_execmem --> on
browser_confine_xguest --> on
browser_write_xguest_data --> on
httpd_execmem --> off
httpd_ssi_exec --> off
xguest_connect_network --> on
xguest_mount_media --> on
xguest_use_bluetooth --> on

Comment 3 Daniel Walsh 2008-11-11 14:27:14 UTC
Well the first avc shows npviewer running as xguest_t, now you show firefox running as xguest_mozilla_t.

# audit2allow -w -i /tmp/t
node=macfed type=AVC msg=audit(1226351324.331:42): avc: denied { execstack } for pid=3237 comm="firefox" scontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tcontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tclass=process node=macfed 

	Was caused by:
	The boolean allow_execmem was set incorrectly. 
	Description:
	Allow unconfined executables to map a memory region as both executable and writable, this is dangerous and the executable should be reported in bugzilla")

	Allow access by executing:
	# setsebool -P allow_execmem 1

Which was default in Fedora 9.

The interesting thing here is that I would have thought xguest_t->firefox->xguest_mozilla_t->nsplugin->nsplugin_t
But you showed xguest_t->nsplugin->xguest_t

I though nsplugin was started by firefox?

Comment 4 Joachim Katzer 2008-11-11 21:58:48 UTC
(In reply to comment #3)
> now you show firefox
> running as xguest_mozilla_t.
> 
> # audit2allow -w -i /tmp/t
> node=macfed type=AVC msg=audit(1226351324.331:42): avc: denied { execstack }
> for pid=3237 comm="firefox" scontext=xguest_u:xguest_r:xguest_mozilla_t:s0
> tcontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tclass=process node=macfed 
> 
>  Was caused by:
>  The boolean allow_execmem was set incorrectly. 
> 
>  Allow access by executing:
>  # setsebool -P allow_execmem 1
> 
> Which was default in Fedora 9.

This was the AVC after uninstalling nspluginwrapper. After turning on allow_execmem, Flash player is starting but still not working properly: no sound and video stopps playing. It doesn't make  much difference whether libflashsupport is installed or not. (Only difference is CPU load of Firefox). Pulseaudio seems to be the cause of the problems.

I have tried to extend the xguest SELinux rules with the audit2allow tool but apparently this would end up in a completely unconfined xguest.
I have given up when audit2allow has generated the following rules:


#============= xdm_t ==============
allow xdm_t lib_t:file execmod;

#============= xguest_mozilla_t ==============
allow xguest_mozilla_t user_tmpfs_t:file unlink;

#============= xguest_t ==============
allow xguest_t fusefs_t:filesystem { mount unmount };
allow xguest_t lib_t:file execmod;
allow xguest_t pulseaudio_port_t:tcp_socket name_connect;
allow xguest_t self:capability { setuid dac_read_search sys_admin dac_override };
allow xguest_t tmpfs_t:file read;


During an xguest session lots of pulseaudio errors are logged to /var/log/messages. I've also tried to add xguest to group pulse-rt w/o success:

Nov 11 22:05:20 localhost pulseaudio[11056]: main.c: Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:
Nov 11 22:05:20 localhost pulseaudio[11056]: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us privileges. Dropping SUID again.
Nov 11 22:05:20 localhost pulseaudio[11056]: main.c: For enabling real-time scheduling please acquire the appropriate PolicyKit privileges, or become a member of 'pulse-rt', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
Nov 11 22:05:20 localhost pulseaudio[11056]: main.c: High-priority scheduling enabled in configuration but not allowed by policy.
Nov 11 22:05:20 localhost pulseaudio[11056]: core-util.c: setpriority(): Keine Berechtigung
Nov 11 22:05:30 localhost gnome-session[10779]: WARNING: Application 'libcanberra-login-sound.desktop' failed to register before timeout
Nov 11 22:05:30 localhost pulseaudio[11132]: pid.c: Daemon already running.
Nov 11 22:05:31 localhost setroubleshoot: SELinux hindert gpk-update-icon (xguest_t) "read" am Zugriff auf ./extra-data.db (var_lib_t). For complete SELinux messages. run sealert -l f319f0c6-a985-4508-9f16-ed1186756a4c
Nov 11 22:05:31 localhost setroubleshoot: [rpc.ERROR] attempt to open server connection failed: Keine Berechtigung
Nov 11 22:05:31 localhost setroubleshoot: SELinux hindert gpk-update-icon (xguest_t) "read" am Zugriff auf ./firmware-BhAckAcu (udev_var_run_t). For complete SELinux messages. run sealert -l cfcbae4c-e421-4abd-bc7f-0c601f8b97a9
Nov 11 22:05:31 localhost setroubleshoot: SELinux hindert gpk-update-icon (xguest_t) "read" am Zugriff auf ./firmware-7Y96inV1 (udev_var_run_t). For complete SELinux messages. run sealert -l f795d59a-b8bc-4574-b927-d21ccb3d06d3
Nov 11 22:06:23 localhost pulseaudio[11061]: shm.c: fstat() failed: Keine Berechtigung
Nov 11 22:06:23 localhost pulseaudio[11061]: pstream.c: Failed to import memory block.

On a normal user account, Flash player and pulseaudio are working fine.

Comment 5 Joachim Katzer 2008-11-11 22:02:34 UTC
(In reply to comment #3)

> The interesting thing here is that I would have thought
> xguest_t->firefox->xguest_mozilla_t->nsplugin->nsplugin_t
> But you showed xguest_t->nsplugin->xguest_t
> 
> I though nsplugin was started by firefox?
I've also tried out the YouTube plugin of Totem (unsuccessfully as to be expected). Probably this AVC was caused by totem.

Comment 6 Joachim Katzer 2008-11-11 23:53:59 UTC
Now it seems I've found the solution to the problem:

Obviously the desktop config files installed with the old /etc/desktop-profiles/xguest.zip are no more compatible with the latest GNOME version.
I've simply created a new sabayon profile and replaced the original xguest.zip.

After that there was only one AVC error left to fix:

node=macfed type=AVC msg=audit(1226446315.248:114): avc: denied { sendto } for pid=5729 comm="firefox" scontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tcontext=xguest_u:xguest_r:xguest_mozilla_t:s0 tclass=unix_dgram_socket 
node=macfed type=SYSCALL msg=audit(1226446315.248:114): arch=40000003 syscall=102 success=no exit=-13 a0=9 a1=bf927a00 a2=106f234 a3=0 items=0 ppid=5715 pid=5729 auid=501 uid=501 gid=501 euid=501 suid=501 fsuid=501 egid=501 sgid=501 fsgid=501 tty=(none) ses=2 comm="firefox" exe="/usr/lib/firefox-3.0.2/firefox" subj=xguest_u:xguest_r:xguest_mozilla_t:s0 key=(null) 

From this I've created a xguestlocal.te policy module with audit2allow -M:

module xguestlocal 1.0;

require {
	type xguest_mozilla_t;
	class unix_dgram_socket sendto;
}

#============= xguest_mozilla_t ==============
allow xguest_mozilla_t self:unix_dgram_socket sendto;


Note for reproducing: 
I've uninstalled nspluginwrapper and called
setsebool -P allow_execmem 1 
as adviced.

Comment 7 Bug Zapper 2008-11-26 05:01:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 Bug Zapper 2009-11-18 08:47:40 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2009-12-18 06:47:04 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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