Bug 1695647 - Dnsmasq will not offer IP address if addn_host contains wrong host name
Summary: Dnsmasq will not offer IP address if addn_host contains wrong host name
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dnsmasq
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Menšík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-03 13:59 UTC by Slawek Kaplonski
Modified: 2019-05-28 23:56 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-28 23:56:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Slawek Kaplonski 2019-04-03 13:59:47 UTC
Description of problem:
When domain name in addn_hosts file is wrong dnsmasq will not offer IP address and instead will only log error message like:

Apr 03 13:49:42 fedora-28-rax-ord-0004670766 dnsmasq[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts - 10 addresses
Apr 03 13:49:42 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/host
Apr 03 13:49:42 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/opts
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 9
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 9
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 10
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 10
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts - 10 addresses
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad DHCP host name at line 5 of /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/host
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/host
Apr 03 13:49:46 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/opts
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 9
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 9
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 10
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad name at /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts line 10
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts - 10 addresses
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq[4277]: bad DHCP host name at line 5 of /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/host
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/host
Apr 03 13:49:47 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: read /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/opts
Apr 03 13:50:07 fedora-28-rax-ord-0004670766 dnsmasq-dhcp[4277]: DHCPDISCOVER(tapf935b1da-f9) fa:16:3e:1a:b9:4d no address available


This file looked like:

[root@fedora-28-rax-ord-0004670766 ~]# cat /opt/stack/data/neutron/dhcp/a931c4fb-084e-4eb6-bc10-03f557a23434/addn_hosts
fd42:1daf:d6b4::1       host-fd42-1daf-d6b4--1.openstackgate.local. host-fd42-1daf-d6b4--1
10.1.0.1        host-10-1-0-1.openstackgate.local. host-10-1-0-1
10.1.0.4        vm1.openstackgate.local. vm1
fd42:1daf:d6b4:0:f816:3eff:fe43:b7d5    vm1.openstackgate.local. vm1
10.1.0.2        host-10-1-0-2.openstackgate.local. host-10-1-0-2
fd42:1daf:d6b4:0:f816:3eff:fef6:4608    host-fd42-1daf-d6b4-0-f816-3eff-fef6-4608.openstackgate.local. host-fd42-1daf-d6b4-0-f816-3eff-fef6-4608
10.1.0.44       to-xsk-test.testowanietobiko-server-testowy.openstackgate.local. to-xsk-test.testowanietobiko-server-testowy
fd42:1daf:d6b4:0:f816:3eff:febf:2f5f    to-xsk-test.testowanietobiko-server-testowy.openstackgate.local. to-xsk-test.testowanietobiko-server-testowy
10.1.0.54       to--this-is-only-test-of.bad.name.openstackgate.local. to--this-is-only-test-of.bad.name
fd42:1daf:d6b4:0:f816:3eff:fe1a:b94d    to--this-is-only-test-of.bad.name.openstackgate.local. to--this-is-only-test-of.bad.name


Version-Release number of selected component (if applicable):
[root@fedora-28-rax-ord-0004670766 ~]# rpm -qa | grep dnsmasq
dnsmasq-utils-2.79-5.fc28.x86_64
dnsmasq-2.79-5.fc28.x86_64


How reproducible:
I used Openstack Neutron with enabled dns_integration to reproduce this issue. I then spawned vm with "bad" name, like "to--this-is-only-test-of.bad.name" - it is then 100% times reproducible


Steps to Reproduce:
1. Configure Openstack neutron with dns integration (https://docs.openstack.org/neutron/latest/admin/config-dns-int.html)
2. Spawn vm with name which starts with something like "broken" IDN domain name, e.g. something like to--test.vm
3. VM will not receive IP address from dnsmasq and in dnsmasq logs there will be errors like mentioned above

Actual results:
No IP address given by DHCP to instance

Expected results:
IP should be configured on VM.

I tested exactly same behavior on Ubuntu 18.04 with:

[15:57:30] vagrant@devstack-ubuntu-ovs /opt/stack/neutron (master)$ sudo dpkg -l | grep dnsmasq
ii  dnsmasq-base                          2.79-1                                 amd64        Small caching DNS proxy and DHCP/TFTP server
ii  dnsmasq-utils                         2.79-1                                 amd64        Utilities for manipulating DHCP leases

and it worked fine. In same case in logs I had:

Apr 03 15:29:39 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/host
Apr 03 15:29:39 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/opts
Apr 03 15:29:40 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/host
Apr 03 15:29:40 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/opts
Apr 03 15:29:41 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/host
Apr 03 15:29:41 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: read /opt/stack/data/neutron/dhcp/7e772033-af64-42ff-b5a8-7ff8b06de3e0/opts
Apr 03 15:29:51 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: DHCPDISCOVER(tap56c7c297-ec) fa:16:3e:10:40:04
Apr 03 15:29:51 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: DHCPOFFER(tap56c7c297-ec) 192.168.210.73 fa:16:3e:10:40:04
Apr 03 15:29:51 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: DHCPREQUEST(tap56c7c297-ec) 192.168.210.73 fa:16:3e:10:40:04
Apr 03 15:29:51 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: Ignoring domain testowanietobiko-server-testowy.openstackgate.local for DHCP host name to--sk-test
Apr 03 15:29:51 devstack-ubuntu-ovs dnsmasq-dhcp[3156]: DHCPACK(tap56c7c297-ec) 192.168.210.73 fa:16:3e:10:40:04 to--sk-test

And all worked fine from VM point of view.

Additional info:

Comment 1 Petr Menšík 2019-04-08 12:14:29 UTC
Thank you for detailed way to reproduce. It might be related to IDN2 support enabled in Fedora.

Comment 2 Petr Menšík 2019-04-08 12:58:27 UTC
Wouldn't be more appropriate to fix openstack to not allow such invalid names in the first place?

I admit idn2 tool does not complain on that invalid name and can process it. Just thinking why we even want to support name that has no valid format. It might be viewed as regression to IDN2 disabled build. It can be fixed in dnsmasq to be able to work with such invalid name. But should not openstack print warnings on management of such hostnames? It is not valid IDN2 name, should be refused on input as invalid. It is too late to refuse it in dnsmasq, but should not be even propagated to it in my opinion. Is there any reason to support such name? Any use case why should not openstack not refuse such names?

Comment 3 Slawek Kaplonski 2019-04-08 13:03:42 UTC
Hi Petr,

I can of course take a look on how to fix/avoid such names on OpenStack side.
But I also reported this issue as the same name used in OpenStack running on Centos 7 and Ubuntu 18.04 wasn't causing same issues.

And the main issue here was that on Fedora in such case IP address wasn't given to the VM which was asking for it.
I agree that dnsmasq shouldn't provide such broken hostname when someone will ask to resolve it but should it simply stop even giving IP address when DHCP request is sent to it?

Comment 4 Petr Menšík 2019-04-24 09:28:35 UTC
It might want to refuse invalid names if DHCP requests it but it is not mentioned in configuration. But I think if administrator used such name in configuration, it should be able to answer. Maybe with a warning on startup used name is not valid. Unless it is refused on startup, it should be able to continue.

Comment 5 Ben Cotton 2019-05-02 19:39:52 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. 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
EOL if it remains open with a Fedora 'version' of '28'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 6 Ben Cotton 2019-05-28 23:56:47 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.