Libvirt provides a portable, long term stable C API for managing the virtualization technologies provided by many operating systems. It includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER Hypervisor.
Go to file
Laine Stump 2abde0ac07 network: use dnsmasq --bind-dynamic when available
This bug resolves CVE-2012-3411, which is described in the following
bugzilla report:

  https://bugzilla.redhat.com/show_bug.cgi?id=833033

The following report is specifically for libvirt on Fedora:

  https://bugzilla.redhat.com/show_bug.cgi?id=874702

In short, a dnsmasq instance run with the intention of listening for
DHCP/DNS requests only on a libvirt virtual network (which is
constructed using a Linux host bridge) would also answer queries sent
from outside the virtualization host.

This patch takes advantage of a new dnsmasq option "--bind-dynamic",
which will cause the listening socket to be setup such that it will
only receive those requests that actually come in via the bridge
interface. In order for this behavior to actually occur, not only must
"--bind-interfaces" be replaced with "--bind-dynamic", but also all
"--listen-address" options must be replaced with a single
"--interface" option. Fully:

   --bind-interfaces --except-interface lo --listen-address x.x.x.x ...

(with --listen-address possibly repeated) is replaced with:

   --bind-dynamic --interface virbrX

Of course libvirt can't use this new option if the host's dnsmasq
doesn't have it, but we still want libvirt to function (because the
great majority of libvirt installations, which only have mode='nat'
networks using RFC1918 private address ranges (e.g. 192.168.122.0/24),
are immune to this vulnerability from anywhere beyond the local subnet
of the host), so we use the new dnsmasqCaps API to check if dnsmasq
supports the new option and, if not, we use the "old" option style
instead. In order to assure that this permissiveness doesn't lead to a
vulnerable system, we do check for non-private addresses in this case,
and refuse to start the network if both a) we are using the old-style
options, and b) the network has a publicly routable IP
address. Hopefully this will provide the proper balance of not being
disruptive to those not practically affected, and making sure that
those who *are* affected get their dnsmasq upgraded.

(--bind-dynamic was added to dnsmasq in upstream commit
54dd393f3938fc0c19088fbd319b95e37d81a2b0, which was included in
dnsmasq-2.63)

(cherry picked from commit 753ff83a50)
Conflicts:
        src/network/bridge_driver.c
        * needed to change virReportError() to the older
          networkReportError()

	tests/networkxml2argvdata/nat-network-dns-txt-record.argv
        * this test file has an example of an arg with embedded space,
          which gets sorrounded by '' in newer releases. Other
          items on the same line had been modified.

	tests/networkxml2argvdata/routed-network.argv
        * in the newer releases, this test file had an --addn-hosts
          arg that didn't exist on this branch. Again, it was in the
          surrounding context of the changes that had been made on
          master.
2012-11-29 21:52:30 -05:00
.gnulib@dbd914496c build: update to latest gnulib, for secure tarball 2012-07-27 11:52:31 -06:00
daemon daemon: Avoid 'Could not find keytab file' in syslog 2012-10-27 15:28:20 -04:00
docs docs: Fix installation of internals/*.html 2012-10-27 15:33:03 -04:00
examples adding handling EINTR to poll to make it more robust 2012-08-12 21:15:46 -04:00
gnulib build: fix fresh checkout on RHEL5 2012-04-25 16:36:26 -04:00
include snapshot: add atomic create flag 2012-03-23 16:38:20 -06:00
m4 maint: make it easier to copy FORTIFY_SOURCE snippet 2012-06-14 18:38:26 -04:00
po Prep for release 0.9.11.7 2012-10-27 16:54:51 -04:00
python python: fix snapshot listing bugs 2012-06-14 18:38:27 -04:00
src network: use dnsmasq --bind-dynamic when available 2012-11-29 21:52:30 -05:00
tests network: use dnsmasq --bind-dynamic when available 2012-11-29 21:52:30 -05:00
tools docs: virsh: clarify behavior of send-key 2012-10-27 15:28:32 -04:00
.dir-locals.el maint: let emacs avoid tabs in rng files 2011-08-13 08:56:26 -06:00
.gitignore Add /tools/libvirt-guests.service to .gitignore 2012-08-12 19:22:30 -04:00
.gitmodules make .gnulib a submodule 2009-07-08 16:17:51 +02:00
.mailmap qemu: add rbd to whitelist of migration-safe formats 2012-08-12 19:22:51 -04:00
AUTHORS dnsmasq: avoid forwarding queries without a domain 2012-10-07 16:49:51 -04:00
autobuild.sh Enable all warnings permanently & default to -Werror for GIT builds 2012-03-27 17:08:06 +01:00
autogen.sh autogen: Always abide --system 2012-08-12 18:34:54 -04:00
bootstrap build: update to latest gnulib, for secure tarball 2012-07-27 11:52:31 -06:00
bootstrap.conf build: update to latest gnulib, for secure tarball 2012-07-27 11:52:31 -06:00
cfg.mk build: update to latest gnulib, for secure tarball 2012-07-27 11:52:31 -06:00
ChangeLog-old virterror.c: Fix several spelling mistakes 2012-02-03 11:32:51 -07:00
configure.ac Prep for release 0.9.11.7 2012-10-27 16:54:51 -04:00
COPYING.LIB remove all trailing blank lines 2009-07-16 15:06:42 +02:00
HACKING Document STREQ_NULLABLE and STRNEQ_NULLABLE 2011-10-06 16:50:38 +02:00
libvirt.pc.in build: silence warning from autoconf 2012-06-14 18:23:21 -04:00
libvirt.spec.in spec: don't enable cgconfig under systemd 2012-11-05 10:55:56 -07:00
Makefile.am maint: add missing copyright notices 2011-07-28 15:01:17 -06:00
Makefile.nonreentrant Ban use of all inet_* functions 2010-10-22 11:59:23 +01:00
mingw32-libvirt.spec.in Fix typos in API XML file paths 2012-02-15 11:29:38 +00:00
README Correct typos in the documentation (Atsushi SAKAI) 2008-01-24 10:15:13 +00:00
README-hacking maint: relax git minimum version 2010-02-24 14:29:27 -05:00
TODO Update todo list file to point at bugzilla/website 2010-10-13 16:45:26 +01:00

         LibVirt : simple API for virtualization

  Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization of
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.

Daniel Veillard <veillard@redhat.com>