Red Hat Bugzilla – Bug 486112
Qemu should not be using pulseaudio when run as root.
Last modified: 2010-06-29 16:30:55 EDT
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?
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.
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 ...
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.
"existing PulseAudio instance that is started at boot"
What existing instance is this? pulseaudio is launched per-user, it isn't a system daemon.
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.
(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
PA refuses to do autospawning for root (getuid() == 0) anyway. No need for such an env var.
Moving back. ;-)
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
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
Would that mean sound from the guest will get properly routed to the hosts pulseaudio server?
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.
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:
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:
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.
This bug is solved in F12 and later, libvirt no longer launches pulseaudio by default.