Bug 486112 - Qemu should not be using pulseaudio when run as root.
Summary: Qemu should not be using pulseaudio when run as root.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-02-18 14:39 UTC by Daniel Walsh
Modified: 2010-06-29 20:30 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-06-29 20:22:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Walsh 2009-02-18 14:39:46 UTC
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 16:08:03 UTC
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 16:18:53 UTC
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 Berrangé 2009-02-18 16:26:22 UTC
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 18:16:00 UTC
"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 Berrangé 2009-04-16 15:34:03 UTC
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 15:14:08 UTC
(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 21:25:02 UTC
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 12:12:06 UTC
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 12:13:17 UTC
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 12:13:44 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Daniel Berrangé 2009-05-07 12:32:38 UTC
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 18:30:03 UTC
Would that mean sound from the guest will get properly routed to the hosts pulseaudio server?

Comment 13 Daniel Berrangé 2009-05-07 19:30:48 UTC
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 19:36:47 UTC
Sweet.

Comment 15 Bug Zapper 2009-06-09 11:28:47 UTC
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 13:00:45 UTC
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 11:18:54 UTC
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 20:22:10 UTC
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.