libnss-resolve treats two trailing dots on a domain name incorrectly

Bug #1600000 reported by Adam Conrad on 2016-07-07
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd
New
Unknown
systemd (Ubuntu)
Medium
Martin Pitt
Xenial
Low
Unassigned

Bug Description

[Impact]
libnss-resolve is an optional component not used by default in xenial. However it treats doubledot incorrectly, meaning it gets resolved when it shouldn't.

[Fix]
Cherrypick upstream patch to resolve this issue.

[Testcase]

* Enable resolve nss module
* attempt resolving www.gnu.org..
* It should fail to resolve

(base)adconrad@nosferatu:~$ getent ahostsv4 www.gnu.org..
208.118.235.148 STREAM wildebeest.gnu.org
208.118.235.148 DGRAM
208.118.235.148 RAW
(base)adconrad@nosferatu:~$ sudo sed -i -e 's/ resolve dns/ dns/' /etc/nsswitch.conf
(base)adconrad@nosferatu:~$ getent ahostsv4 www.gnu.org..
(base)adconrad@nosferatu:~$ sudo sed -i -e 's/ dns/ resolve dns/' /etc/nsswitch.conf
(base)adconrad@nosferatu:~$ getent ahostsv4 www.gnu.org..
208.118.235.148 STREAM wildebeest.gnu.org
208.118.235.148 DGRAM
208.118.235.148 RAW
(base)adconrad@nosferatu:~$

This is responsible for the new regression in glibc:

----------
FAIL: posix/tst-getaddrinfo5
original exit status 1
resolving "localhost." worked, proceeding to test
resolving "localhost.." failed, test passed
resolving "www.gnu.org." worked, proceeding to test
resolving "www.gnu.org.." worked, test failed
----------

[Regression potential]
Minimal, since this component is not used by default. However, systems that have this enabled exhibit standards non-compliant behavior. It is not expected for anybody to depend on this broken behavior.

Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu):
status: New → Triaged
tags: added: resolve
tags: added: yakkety
Changed in systemd:
status: Unknown → New
Martin Pitt (pitti) wrote :
Changed in systemd (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Medium
status: Triaged → In Progress
Martin Pitt (pitti) wrote :

Adam asked to fix that in Xenial too; we don't enable resolved there by default, but folks can manually enable it. It's not a bug that realistically breaks stuff in practice, but it's simple to fix.

Changed in systemd (Ubuntu Xenial):
importance: Undecided → Low
status: New → Triaged
Martin Pitt (pitti) wrote :

Landed upstream, cherry-picked into debian packaging: https://anonscm.debian.org/cgit/pkg-systemd/systemd.git/commit/?id=061c04b

We'll land that, double-check that glibc is happy, and then SRU.

Changed in systemd (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 231-6

---------------
systemd (231-6) unstable; urgency=medium

  [ Martin Pitt ]
  * Add alternative iptables-dev build dependencies
    libiptc-dev is very new and not yet present in stable Debian/Ubuntu releases.
    Add it as a fallback build dependency for backports and upstream tests.
  * Detect if seccomp is enabled but seccomp filtering is disabled
    (Closes: #832713)
  * resolved: recognize DNS names with more than one trailing dot as invalid
    (LP: #1600000)
  * debian/tests/smoke: Store udev db dump artifact on failure
  * networkd: limit the number of routes to the kernel limit
  * systemctl: consider service running only when it is in active or reloading state
  * networkd: remove route if carrier is lost
  * Add Ref()/Unref() bus calls for units

  [ Felipe Sateler ]
  * git-cherry-pick: always recreate the patch-queue branch.

  [ Dimitri John Ledkov ]
  * Use idiomatic variables from dpkg include.

 -- Martin Pitt <email address hidden> Sun, 11 Sep 2016 15:00:55 +0200

Changed in systemd (Ubuntu):
status: Fix Committed → Fix Released
Changed in systemd (Ubuntu Xenial):
milestone: none → ubuntu-16.04.3
Changed in systemd (Ubuntu Xenial):
status: Triaged → In Progress

Thanks for uploading the fix for this bug report to -proposed. However, when reviewing the package in -proposed and the details of this bug report I noticed that the bug description is missing information required for the SRU process. You can find full details at http://wiki.ubuntu.com/StableReleaseUpdates#Procedure but essentially this bug is missing some of the following: a statement of impact, a test case and details regarding the regression potential. Thanks in advance!

description: updated

Hello Adam, or anyone else affected,

Accepted systemd into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/229-4ubuntu20 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-xenial
Dimitri John Ledkov (xnox) wrote :

229-4ubuntu19
# systemd-resolve www.gnu.org..
www.gnu.org..: 208.118.235.148
               2001:4830:134:3::a
               (www.gnu.org)

-- Information acquired via protocol DNS in 1.8ms.
-- Data is authenticated: no

Which is BAD.

229-4ubuntu20
# systemd-resolve www.gnu.org..
www.gnu.org..: resolve call failed: Invalid hostname 'www.gnu.org..'

Which is GOOD and standards compliant.

tags: added: verification-done verification-done-xenial
removed: verification-needed verification-needed-xenial
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.