Bug 847520 - Firefox (with Flash video) inside sandbox gains exclusive lock on sound
Firefox (with Flash video) inside sandbox gains exclusive lock on sound
Product: Fedora
Classification: Fedora
Component: pulseaudio (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Lennart Poettering
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-08-12 11:39 EDT by Robin Green
Modified: 2013-07-31 23:11 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 681701
Last Closed: 2013-07-31 23:10:56 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Robin Green 2012-08-12 11:39:26 EDT
Cloning because I can repeat this on F17.

+++ This bug was initially created as a clone of Bug #681701 +++

Description of problem:
When Firefox is playing a video inside a sandbox - and even when the video is paused - pulseaudio locks, so if mplayer tries to play something from outside the sandbox, it blocks.

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

How reproducible:

Steps to Reproduce:
1. yum install policycoreutils-sandbox metacity
2. reboot
3. sandbox -X -H sandboxes/music/ -t sandbox_web_t -W metacity firefox
4. Go to youtube.com and play a video
5. (Optional) Pause the video
6. Outside of the sandbox, try to play some music using mplayer
Actual results:
mplayer hangs at 0.0%

Expected results:
mplayer should play the song or stream

Additional info:
Afterwards, it's necessary to killall pulseaudio, to get sound working again. (Pulseaudio bug?) Something automatically respawns pulseaudio as soon as you kill it. Then you might have to try playing music a couple of times before it works.

This bug does not happen when firefox is not run inside a sandbox.
Comment 1 Daniel Walsh 2012-08-13 16:31:36 EDT
Are you seeing any AVC messages when this happens?
Comment 2 Robin Green 2012-08-15 18:06:36 EDT
Nothing that's relevant, I think - however, I realised I needed to supply the argument

-i ~/.pulse-cookie

to sandbox. I then got some AVCs (I'm on Fedora 18 now, by the way), and I created the following policy but it didn't solve the problem:

allow sandbox_web_client_t mozilla_plugin_tmpfs_t:file read;
allow sandbox_web_client_t mozilla_plugin_tmpfs_t:file open;
allow sandbox_web_client_t mozilla_plugin_tmpfs_t:file getattr;
allow sandbox_web_client_t mozilla_plugin_t:process signull;
Comment 3 Robin Green 2012-08-15 18:12:32 EDT
Ah, I see the problem - it's not related to AVCs, but to the hiding of /tmp - from strace mplayer:

[pid 31880] connect(7, {sa_family=AF_FILE, sun_path=@"/tmp/.X11-unix/X0"}, 20) = 0
[pid 31880] getpeername(7, {sa_family=AF_FILE, sun_path=@"/tmp/.X11-unix/X0"}, [20]) = 0
[pid 31880] access("/tmp/kde-greenrd/xauth-500-_0", R_OK) = 0
[pid 31880] open("/tmp/kde-greenrd/xauth-500-_0", O_RDONLY) = 8
[pid 31880] connect(7, {sa_family=AF_FILE, sun_path="/tmp/pulse-BLCj9pKNG1Nk/native"}, 110) = 0

Obviously that last connect is not going to be possible inside the sandbox if /tmp is hidden. Once again, it seems that to get stuff to work it would be necessary to move things out of /tmp (or stop hiding /tmp).
Comment 4 Daniel Walsh 2012-08-16 09:39:53 EDT
You could try -I /tmp/kde-greerd, but this stuff should probably be in /run/user/UID/ 

Comment 5 Fedora End Of Life 2013-07-03 19:59:15 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. 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 '17'.

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 17'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 17 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, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

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.
Comment 6 Fedora End Of Life 2013-07-31 23:11:03 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 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.