libvirt/tests
Laine Stump 9eb2b57325 network: prevent dnsmasq from listening on localhost
This patch resolves the problem reported in:

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

The source of the problem was the fix for CVE 2011-3411:

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

which was originally committed upstream in commit
753ff83a50. That commit improperly
removed the "--except-interface lo" from dnsmasq commandlines when
--bind-dynamic was used (based on comments in the latter bug).

It turns out that the problem reported in the CVE could be eliminated
without removing "--except-interface lo", and removing it actually
caused each instance of dnsmasq to listen on localhost on port 53,
which created a new problem:

If another instance of dnsmasq using "bind-interfaces" (instead of
"bind-dynamic") had already been started (or if another instance
started later used "bind-dynamic"), this wouldn't have any immediately
visible ill effects, but if you tried to start another dnsmasq
instance using "bind-interfaces" *after* starting any libvirt
networks, the new dnsmasq would fail to start, because there was
already another process listening on port 53.

This patch changes the network driver to *always* add
"except-interface=lo" to dnsmasq conf files, regardless of whether we use
bind-dynamic or bind-interfaces. This way no libvirt dnsmasq instances
are listening on localhost (and the CVE is still fixed).

The actual code change is miniscule, but must be propogated through all
of the test files as well.

(This is *not* a cherry-pick of the upstream commit that fixes the bug
(commit d66eb78667), because subsequent
to the CVE fix, another patch changed the network driver to put
dnsmasq options in a conf file rather than directly on the dnsmasq
commandline preserving the same options), so a cherry-pick is just one
very large conflict.)
2012-12-13 12:43:58 -05:00
..
capabilityschemadata
commanddata command: avoid deadlock on EPIPE situation 2012-06-14 18:38:25 -04:00
confdata Change the default of mdns_adv to false 2012-03-27 09:54:49 -06:00
cputestdata Removed more AMD-specific features from cpu64-rhel* models 2012-03-09 14:36:31 +01:00
domainschemadata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
domainsnapshotxml2xmlin
domainsnapshotxml2xmlout qemu: Support numad 2012-03-15 12:24:56 +08:00
interfaceschemadata
lxcxml2xmldata Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
networkxml2argvdata network: prevent dnsmasq from listening on localhost 2012-12-13 12:43:58 -05:00
networkxml2xmlin
networkxml2xmlout
nodedevschemadata
nodeinfodata
nwfilterxml2xmlin
nwfilterxml2xmlout
qemuhelpdata
qemuxml2argvdata qemu: pass -usb and usb hubs earlier, so USB disks with static address are handled properly 2012-12-09 17:48:11 -05:00
qemuxml2xmloutdata Set a sensible default master start port for ehci companion controllers 2012-06-14 18:22:30 -04:00
qemuxmlnsdata qemu: pass -usb and usb hubs earlier, so USB disks with static address are handled properly 2012-12-09 17:48:11 -05:00
sexpr2xmldata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
storagepoolxml2xmlin
storagepoolxml2xmlout xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
storagevolxml2xmlin storage: support more scaling suffixes 2012-03-07 18:24:43 -07:00
storagevolxml2xmlout xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
vmx2xmldata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
xencapsdata
xmconfigdata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2sexprdata Xen: Fix <clock> handling 2012-04-02 09:33:54 -06:00
xml2vmxdata xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
.valgrind.supp
capabilityschematest
commandhelper.c command: avoid deadlock on EPIPE situation 2012-06-14 18:38:25 -04:00
commandtest.c command: avoid deadlock on EPIPE situation 2012-06-14 18:38:25 -04:00
conftest.c
cpuset
cputest.c test: fix build errors with gcc 4.7.0 and -O0 2012-04-16 12:39:58 +01:00
daemon-conf
define-dev-segfault xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
domainschematest Add LXC XML files to schema test & fix problems this uncovers 2012-03-27 15:52:25 +01:00
domainsnapshotschematest
domainsnapshotxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
esxutilstest.c
eventtest.c
int-overflow
interfaceschematest
interfacexml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
jsontest.c
libvirtd-fail
libvirtd-pool
lxcxml2xmltest.c build: silence recent syntax check violations 2012-03-29 21:23:59 -06:00
Makefile.am tests: run valgrind on real executables, not libtool wrappers 2012-06-14 18:22:52 -04:00
networkschematest
networkxml2argvtest.c util: capabilities detection for dnsmasq 2012-11-29 16:29:14 -05:00
networkxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nodedevschematest
nodedevxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nodeinfotest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
nwfilterschematest
nwfilterxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
object-locking.ml
oomtrace.pl
openvzutilstest.c xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
openvzutilstest.conf
pkix_asn1_tab.c
qemuargv2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
qemuhelptest.c qemu: Use scsi-block for lun passthrough instead of scsi-disk 2012-03-14 23:32:53 +08:00
qemumonitortest.c qemu: unescape HMP commands before converting them to json 2012-02-27 16:06:02 -07:00
qemuxml2argvtest.c Fix for parallel port passthrough for QEMU 2012-06-14 18:38:26 -04:00
qemuxml2xmltest.c Fix logic for assigning PCI addresses to USB2 companion controllers 2012-06-14 18:16:49 -04:00
qemuxmlnstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
read-bufsiz
read-non-seekable
reconnect.c
schematestutils.sh
seclabeltest.c tests: avoid seclabeltest crash 2012-08-12 21:15:48 -04:00
sexpr2xmltest.c Consistent style for usage of sizeof operator 2012-03-30 11:47:24 +01:00
shunloadhelper.c
shunloadtest.c
sockettest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
ssh.c Disable build of commandhelper & ssh on Win32 2012-03-30 11:47:14 +01:00
start
statstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
storagepoolschematest
storagepoolxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
storagevolschematest
storagevolxml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
test_conf.sh
test-lib.sh
testutils.c tests: back to short test names 2012-06-14 18:22:52 -04:00
testutils.h Fix format specifiers in test cases on Win32 2012-04-16 12:39:05 +01:00
testutilslxc.c Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilslxc.h Add support for setting init argv for LXC 2012-03-27 15:52:25 +01:00
testutilsqemu.c tests: avoid compiler warnings 2012-04-16 12:40:02 +01:00
testutilsqemu.h
testutilsxen.c
testutilsxen.h
undefine
utiltest.c
vcpupin
virauthconfigtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virbuftest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virhashdata.h Rename hash.h and hash.c to virhash.h and virhash.c 2012-01-26 14:11:13 +00:00
virhashtest.c Fix format specifiers in test cases on Win32 2012-04-16 12:39:05 +01:00
virkeyfiletest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virnetmessagetest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virnetsockettest.c Fix test failure when no IPv6 is avail 2012-08-12 19:23:51 -04:00
virnettlscontexttest.c test: fix build errors with gcc 4.7.0 and -O0 2012-04-16 12:39:58 +01:00
virsh-all
virsh-optparse
virsh-schedinfo
virsh-synopsis
virshtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virt-aa-helper-test
virtimetest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
viruritest.c tests: avoid compiler warnings 2012-04-16 12:40:02 +01:00
vmx2xmltest.c vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00
xencapstest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xmconfigtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xml2sexprtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
xml2vmxtest.c vmx: Better Workstation vmx handling 2012-02-24 11:53:23 +01:00