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 microblaze: Add architecture support 2011-07-07 17:49:21 -06:00
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 snapshot: also support disks by path 2011-09-05 07:03:04 -06:00
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 Adding the element pf to network xml. 2012-01-11 13:10:21 -07:00
networkxml2xmlout Adding the element pf to network xml. 2012-01-11 13:10:21 -07:00
nodedevschemadata
nodeinfodata Modify the tests/nodeinfotest.c to use sysfs in addition 2011-12-08 08:39:26 -05:00
nwfilterxml2xmlin Add test cases for new ways to access variables in filters 2012-01-11 06:42:37 -05:00
nwfilterxml2xmlout Add test cases for new ways to access variables in filters 2012-01-11 06:42:37 -05:00
qemuhelpdata Add support for QEMU 1.0 2011-12-05 13:02:54 +01:00
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 Add suspend info to Xen, LXC and UML hypervisor capabilities 2011-11-30 10:12:30 +00:00
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 build: properly skip tests 2011-12-01 13:49:20 -07:00
eventtest.c
int-overflow tests: Don't use bash if we don't have to 2011-07-29 17:17:21 +02:00
interfaceschematest
interfacexml2xmltest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
jsontest.c Add test case for parsing JSON docs 2011-06-30 18:04:02 +01:00
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 maint: typo fixes 2011-06-24 08:01:10 -06:00
oomtrace.pl maint: mark more perl scripts executable 2011-05-16 10:12:21 -06:00
openvzutilstest.c xml: output memory unit for clarity 2012-03-07 18:24:43 -07:00
openvzutilstest.conf openvz: Add simple test for openvzReadNetworkConf 2011-06-01 11:58:15 +02:00
pkix_asn1_tab.c Add a test case for certificate validation 2011-07-22 15:18:32 +01:00
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 tests: avoid xend ABRT crash report 2011-11-18 15:00:18 -07:00
schematestutils.sh tests: fix schema checks sorting 2011-12-22 13:01:09 -07:00
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 Prevent crash from dlclose() of libvirt.so 2011-09-16 15:51:31 -06:00
shunloadtest.c build: properly skip tests 2011-12-01 13:49:20 -07:00
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 tests: simplify formatting 2011-07-11 09:21:37 -06:00
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 Fix default console type setting 2011-11-03 12:01:48 +00:00
testutilsxen.h
undefine virsh: properly interleave shared stdout and stderr 2011-08-19 09:22:22 -06:00
utiltest.c build: avoid 'make syntax-check' failure 2011-07-01 16:46:20 -06:00
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 build: update to latest gnulib 2011-12-01 14:12:59 -07:00
virsh-schedinfo build: update to latest gnulib 2011-12-01 14:12:59 -07:00
virsh-synopsis
virshtest.c Cleanup for a return statement in source files 2012-03-26 14:45:22 -06:00
virt-aa-helper-test fix AppArmor driver for pipe character devices 2011-09-28 15:43:39 +08:00
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