diff options
author | Laine Stump <laine@laine.org> | 2012-12-13 01:46:40 -0500 |
---|---|---|
committer | Laine Stump <laine@laine.org> | 2012-12-13 12:15:03 -0500 |
commit | d66eb7866757dd371560c288dc6201fb9348792a (patch) | |
tree | b5d56ff12fa638d6de840febc6094e325e493051 /tests/networkxml2confdata | |
parent | d0d3e92d0bfddf1400c5d7a7725b3d3ec5fb5ed1 (diff) | |
download | libvirt-d66eb7866757dd371560c288dc6201fb9348792a.tar.gz |
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
753ff83a50263d6975f88d6605d4b5ddfcc97560. 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.
(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, but preserved the same options.)
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.
Diffstat (limited to 'tests/networkxml2confdata')
12 files changed, 12 insertions, 4 deletions
diff --git a/tests/networkxml2confdata/dhcp6-nat-network.conf b/tests/networkxml2confdata/dhcp6-nat-network.conf index d4889007a8..050f3dbecc 100644 --- a/tests/networkxml2confdata/dhcp6-nat-network.conf +++ b/tests/networkxml2confdata/dhcp6-nat-network.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr0 dhcp-range=192.168.122.2,192.168.122.254 diff --git a/tests/networkxml2confdata/dhcp6-network.conf b/tests/networkxml2confdata/dhcp6-network.conf index 5c1030c708..5fde07fbd1 100644 --- a/tests/networkxml2confdata/dhcp6-network.conf +++ b/tests/networkxml2confdata/dhcp6-network.conf @@ -9,6 +9,7 @@ domain-needed domain=mynet expand-hosts local=/mynet/ +except-interface=lo bind-dynamic interface=virbr0 dhcp-range=2001:db8:ac10:fd01::1:10,2001:db8:ac10:fd01::1:ff diff --git a/tests/networkxml2confdata/dhcp6host-routed-network.conf b/tests/networkxml2confdata/dhcp6host-routed-network.conf index cb4d0cc41d..f8f05c24c3 100644 --- a/tests/networkxml2confdata/dhcp6host-routed-network.conf +++ b/tests/networkxml2confdata/dhcp6host-routed-network.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr1 dhcp-range=192.168.122.1,static diff --git a/tests/networkxml2confdata/isolated-network.conf b/tests/networkxml2confdata/isolated-network.conf index 55a44d32a4..f8997bda58 100644 --- a/tests/networkxml2confdata/isolated-network.conf +++ b/tests/networkxml2confdata/isolated-network.conf @@ -7,8 +7,8 @@ strict-order domain-needed local=// -bind-interfaces except-interface=lo +bind-interfaces listen-address=192.168.152.1 dhcp-option=3 no-resolv diff --git a/tests/networkxml2confdata/nat-network-dns-hosts.conf b/tests/networkxml2confdata/nat-network-dns-hosts.conf index ae8f8c5abb..2577882958 100644 --- a/tests/networkxml2confdata/nat-network-dns-hosts.conf +++ b/tests/networkxml2confdata/nat-network-dns-hosts.conf @@ -9,6 +9,7 @@ domain-needed domain=example.com expand-hosts local=/example.com/ +except-interface=lo bind-dynamic interface=virbr0 addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf index faa36e697d..1e9b59c512 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf +++ b/tests/networkxml2confdata/nat-network-dns-srv-record-minimal.conf @@ -7,8 +7,8 @@ strict-order domain-needed local=// -bind-interfaces except-interface=lo +bind-interfaces listen-address=192.168.122.1 listen-address=192.168.123.1 listen-address=fc00:db8:ac10:fe01::1 diff --git a/tests/networkxml2confdata/nat-network-dns-srv-record.conf b/tests/networkxml2confdata/nat-network-dns-srv-record.conf index 60799121fe..53d044a40c 100644 --- a/tests/networkxml2confdata/nat-network-dns-srv-record.conf +++ b/tests/networkxml2confdata/nat-network-dns-srv-record.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr0 srv-host=name.tcp.test-domain-name,.,1024,10,10 diff --git a/tests/networkxml2confdata/nat-network-dns-txt-record.conf b/tests/networkxml2confdata/nat-network-dns-txt-record.conf index c448bdc1bc..921cae1607 100644 --- a/tests/networkxml2confdata/nat-network-dns-txt-record.conf +++ b/tests/networkxml2confdata/nat-network-dns-txt-record.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr0 txt-record=example,example value diff --git a/tests/networkxml2confdata/nat-network.conf b/tests/networkxml2confdata/nat-network.conf index 8f28fef079..beb714b134 100644 --- a/tests/networkxml2confdata/nat-network.conf +++ b/tests/networkxml2confdata/nat-network.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr0 dhcp-range=192.168.122.2,192.168.122.254 diff --git a/tests/networkxml2confdata/netboot-network.conf b/tests/networkxml2confdata/netboot-network.conf index 83dd2b3eb3..b6f3c23f15 100644 --- a/tests/networkxml2confdata/netboot-network.conf +++ b/tests/networkxml2confdata/netboot-network.conf @@ -9,8 +9,8 @@ domain-needed domain=example.com expand-hosts local=/example.com/ -bind-interfaces except-interface=lo +bind-interfaces listen-address=192.168.122.1 dhcp-range=192.168.122.2,192.168.122.254 dhcp-no-override diff --git a/tests/networkxml2confdata/netboot-proxy-network.conf b/tests/networkxml2confdata/netboot-proxy-network.conf index b266d81ab8..1e969fac6b 100644 --- a/tests/networkxml2confdata/netboot-proxy-network.conf +++ b/tests/networkxml2confdata/netboot-proxy-network.conf @@ -9,8 +9,8 @@ domain-needed domain=example.com expand-hosts local=/example.com/ -bind-interfaces except-interface=lo +bind-interfaces listen-address=192.168.122.1 dhcp-range=192.168.122.2,192.168.122.254 dhcp-no-override diff --git a/tests/networkxml2confdata/routed-network.conf b/tests/networkxml2confdata/routed-network.conf index dc53a4e1c8..62ffd7a29a 100644 --- a/tests/networkxml2confdata/routed-network.conf +++ b/tests/networkxml2confdata/routed-network.conf @@ -7,6 +7,7 @@ strict-order domain-needed local=// +except-interface=lo bind-dynamic interface=virbr1 addn-hosts=/var/lib/libvirt/dnsmasq/local.addnhosts |