Bug 486112 - Qemu should not be using pulseaudio when run as root.
Qemu should not be using pulseaudio when run as root.
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: libvirt (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Daniel Veillard
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-18 09:39 EST by Daniel Walsh
Modified: 2010-06-29 16:30 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-29 16:22:21 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 Daniel Walsh 2009-02-18 09:39:46 EST
Description of problem:

When trying to confine qemu when it is launched from libvirt, qemu is attempts to manipulate the .pulse directory in /root  If I launch multiple qemu from libvirt they all want to read and write these files.  This allows an avenue of attack.  Why is qemu using pulseaudio at all especially as root?
Comment 1 Jeremy Katz 2009-02-18 11:08:03 EST
qemu provides a sound device to the guests and then needs to hook that up to physical sound output.  And all sound output goes through pulseaudio.
Comment 2 Daniel Walsh 2009-02-18 11:18:53 EST
So Jeremy is this required if the qemu is running as root?  If I added alternate homedir per guest, would pulseaudio still work

HOME=/var/lib/libvirt/qemu/IMAGE/ qemu-kvm ...
Comment 3 Daniel Berrange 2009-02-18 11:26:22 EST
For privileged usage, QEMU should just connect to an existing PulseAudio instance that is started at boot, so it should not need to create files in /root/.pulse. Autospawning of the pulse daemon should only be done when running QEMU in the unprivileged user session.
Comment 4 Warren Togami 2009-04-15 14:16:00 EDT
"existing PulseAudio instance that is started at boot"

What existing instance is this?  pulseaudio is launched per-user, it isn't a system daemon.
Comment 5 Daniel Berrange 2009-04-16 11:34:03 EDT
Pulseaudio can be run per-user, or as a single-system wide instance. Fedora happens to not provide any initscript for running a system wide instance, but pulseaudio supports it just fine. 

The problem remains, that when run as root, if no system instance is found, pulseaudio will try to spawn a new "per-user' instance for root. 

As a temporary workaround, libvirt is forceably disabling all audio in QEMU instances it runs as root. Once we get a way to turn off autospawning of pulseaudio daemons as root, we'll turn it back on.  pulseaudio allows auto-spawn to be disabled in a /etc/pulse/client.conf, but unfortunately not yet via a environment variable which is really what libvirt needs, because we don't want to turn of autospawning for every user of pulse, just for QEMU instances we run as root.
Comment 6 Mark McLoughlin 2009-04-19 11:14:08 EDT
(In reply to comment #5)

> pulseaudio allows
> auto-spawn to be disabled in a /etc/pulse/client.conf, but unfortunately not
> yet via a environment variable which is really what libvirt needs, because we
> don't want to turn of autospawning for every user of pulse, just for QEMU
> instances we run as root.  


Okay, moving to pulseaudio then
Comment 7 Lennart Poettering 2009-04-19 17:25:02 EDT
PA refuses to do autospawning for root (getuid() == 0) anyway. No need for such an env var.

Moving back. ;-)
Comment 8 Fedora Admin XMLRPC Client 2009-05-07 08:12:06 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 9 Fedora Admin XMLRPC Client 2009-05-07 08:13:17 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 10 Fedora Admin XMLRPC Client 2009-05-07 08:13:44 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 11 Daniel Berrange 2009-05-07 08:32:38 EDT
Accidentally discovered the other day that the QEMU in Fedora already supports a VNC extension to pass audio back to the client over VNC. Thus we should simply launch QEMU with a NULL audio backend for VNC configs, and make GTK-VNC implement this extension
Comment 12 Julian Sikorski 2009-05-07 14:30:03 EDT
Would that mean sound from the guest will get properly routed to the hosts pulseaudio server?
Comment 13 Daniel Berrange 2009-05-07 15:30:48 EDT
Audio from QEMU would get sent back over VNC, and the VNC client would send it to whatever sound system is active in your desktop session, pulseaudio-via-gstreamer on Fedora i guess.
Comment 14 Julian Sikorski 2009-05-07 15:36:47 EDT
Sweet.
Comment 15 Bug Zapper 2009-06-09 07:28:47 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 16 Bug Zapper 2010-04-27 09:00:45 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  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 '11'.

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 11'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 11 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 17 Bug Zapper 2010-06-28 07:18:54 EDT
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 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.
Comment 18 Cole Robinson 2010-06-29 16:22:10 EDT
This bug is solved in F12 and later, libvirt no longer launches pulseaudio by default.

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