missing DOMAINSEARCH in initramfs output files if the DHCP server doesn't provide one

Bug #1713747 reported by Mathieu Trudel-Lapierre
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
isc-dhcp (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre
Xenial
Triaged
High
Mathieu Trudel-Lapierre
Zesty
Fix Released
High
Unassigned
klibc (Ubuntu)
Fix Released
Medium
Mathieu Trudel-Lapierre
Xenial
Fix Released
High
Mathieu Trudel-Lapierre
Zesty
Fix Released
Medium
Mathieu Trudel-Lapierre

Bug Description

[Impact]
Systems booted off the network where the DHCP server provides a domain name but no search domains may wish to rely on the domain name as a search value (as is done in isc-dhcp in userland, outside the initramfs), to be able to use short names for resolving hosts.

[Test cases]
1) Boot a system with a remote root over the network
 - Typically this requires adding ip=(some IP settings) or ip=dhcp on the kernel command-line, and is better done automatically.
One good setup for this is to use MaaS to configure the system; where it will require a remote root over iSCSI.
2) Break boot in the initramfs (adding 'break=bottom' or 'break=premount' to stop in the initramfs at its end, or just before it mounts filesystems)
3) Validate the contents of /etc/resolv.conf and /run/net-*.conf.

[Regression potential]
Potential regressions would include incorrectly resolving names, bad configuration of /etc/resolv.conf (invalid values for the fields, or missing fields), or even failure to mount the remote root in the cases where name resolution is required to find the remote server.

--

For networked systems, for instance booting with an iSCSI root, dhclient writes an output file in the form of /run/net-<iface>.conf that contains data for other programs to consume. This allows, for instance, open-iscsi to get the right information and properly connect to the server to mount the root filesystem.

It is common for DHCP servers to only provide a domain name value, and no search domains. In this case, isc-dhcp doesn't currently write DOMAINSEARCH, but people may wish to use short names to resolve things (such as in iSCSI server).

In the not-initramfs dhclient-script, when domain_search isn't provided but domain_name is, domain_name is written to the search string. If both are provided, domain_search is written. The initramfs enter hook should do the same.

Related branches

Changed in isc-dhcp (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in isc-dhcp (Ubuntu Xenial):
status: New → In Progress
importance: Undecided → High
Changed in isc-dhcp (Ubuntu Zesty):
importance: Undecided → High
Changed in isc-dhcp (Ubuntu Xenial):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in isc-dhcp (Ubuntu Zesty):
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isc-dhcp - 4.3.5-3ubuntu2

---------------
isc-dhcp (4.3.5-3ubuntu2) artful; urgency=medium

  * debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config: fix the
    logic for handling search domains to also write it to the output file when
    only the domain name is provided by the DHCP server. Copied code from
    debian/dhclient-script.linux. (LP: #1713747)

 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 14 Sep 2017 15:41:06 -0700

Changed in isc-dhcp (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Mathieu, or anyone else affected,

Accepted isc-dhcp into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/isc-dhcp/4.3.5-3ubuntu1.1 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-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. 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 isc-dhcp (Ubuntu Zesty):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-zesty
Revision history for this message
Chris J Arges (arges) wrote :
description: updated
Changed in isc-dhcp (Ubuntu Xenial):
status: In Progress → Invalid
Changed in klibc (Ubuntu):
status: New → Triaged
Changed in klibc (Ubuntu Xenial):
status: New → Triaged
Changed in klibc (Ubuntu Zesty):
status: New → Triaged
Changed in klibc (Ubuntu):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in klibc (Ubuntu Xenial):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in klibc (Ubuntu Zesty):
assignee: nobody → Mathieu Trudel-Lapierre (cyphermox)
Changed in klibc (Ubuntu):
importance: Undecided → Medium
Changed in klibc (Ubuntu Xenial):
importance: Undecided → High
Changed in klibc (Ubuntu Zesty):
importance: Undecided → Medium
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Turns out this is something directly in klibc in the case of xenial: since xenial is not yet using isc-dhcp for IPv4 DHCP, since that was deemed too intrusive a change for xenial.

In other words, while DHCPv6 is done via isc-dhcp, DHCPv4 is done via ipconfig (klibc); which will need to be fixed to follow the same logic as isc-dhcp w.r.t DOMAINSEARCH handling.

In general, I think having DOMAINSEARCH contain the existing DNS domain if it's not otherwise set by the DHCP server is sensible.

I set the xenial task to High since it might actually impact a lot of people, but it's not as high for artful/zesty given that isc-dhcp is used instead (still ought to land there since people might want to use ipconfig on their own, etc.).

Changed in isc-dhcp (Ubuntu Xenial):
status: Invalid → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package klibc - 2.0.4-9ubuntu2

---------------
klibc (2.0.4-9ubuntu2) bionic; urgency=medium

  * Write DNS domain in place of DOMAINSEARCH if that wasn't provided by the
    DHCP server. (LP: #1713747)
    - 0001-Write-DNS-domain-from-DHCP-if-we-have-no-DOMAINSEARC.patch

 -- Mathieu Trudel-Lapierre <email address hidden> Thu, 09 Nov 2017 16:14:08 -0500

Changed in klibc (Ubuntu):
status: Triaged → Fix Released
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Mathieu, or anyone else affected,

Accepted klibc into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/klibc/2.0.4-8ubuntu4.1 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-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. 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 klibc (Ubuntu Zesty):
status: Triaged → Fix Committed
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Mathieu, or anyone else affected,

Accepted klibc into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/klibc/2.0.4-8ubuntu1.16.04.4 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 klibc (Ubuntu Xenial):
status: Triaged → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I accepted the packages as is. Was worried a bit as the patch is not handling the case of dev->dnsdomainname being NULL when being passed to write_option() (causing a SEGFAULT), but as per discussion with Matt - since upstream doesn't do a check for it != NULL it might mean such a case is not really a possible edge case.

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification-done for zesty, with klibc-utils 2.0.4-8ubuntu4.1:

I updated klibc-utils and libklic; then modified the initramfs scripts/functions to add "maybe-break networking" to the end of configure_networking(); and rebooted with 'ip=dhcp break=networking'. I could then verify the contents of /run/net-ens3.conf from the initramfs environment; which checks out: DOMAINSEARCH shows the right value for this network: "nat", same as DNSDOMAIN.

tags: added: verification-done-zesty
removed: verification-needed-zesty
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification-done for xenial with klibc 2.0.4-8ubuntu1.16.04.4:

I verified that updating klibc-utils to the new version yields a /run/net-ens3.conf file that contains the proper value at DOMAINSEARCH=.

As for the above test on zesty, this involved modifying scripts/functions to allow breaking the boot at initramfs after networking to validate the file contents early.

tags: added: verification-done-xenial
removed: verification-needed verification-needed-xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package klibc - 2.0.4-8ubuntu1.16.04.4

---------------
klibc (2.0.4-8ubuntu1.16.04.4) xenial; urgency=medium

  * Write DNS domain in place of DOMAINSEARCH if that wasn't provided by the
    DHCP server. (LP: #1713747)
    - 0001-Write-DNS-domain-from-DHCP-if-we-have-no-DOMAINSEARC.patch

 -- Mathieu Trudel-Lapierre <email address hidden> Fri, 10 Nov 2017 16:31:40 -0500

Changed in klibc (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for klibc has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package klibc - 2.0.4-8ubuntu4.1

---------------
klibc (2.0.4-8ubuntu4.1) zesty; urgency=medium

  * Write DNS domain in place of DOMAINSEARCH if that wasn't provided by the
    DHCP server. (LP: #1713747)
    - 0001-Write-DNS-domain-from-DHCP-if-we-have-no-DOMAINSEARC.patch

 -- Mathieu Trudel-Lapierre <email address hidden> Fri, 10 Nov 2017 16:35:19 -0500

Changed in klibc (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Verification done for isc-dhcp 4.3.5-3ubuntu1.1 as well:

If you manually enable using dhclient for ipv4 networking in the initramfs, the system behaves as expected and correctly writes DOMAINSEARCH in the /run/net-*.conf files. Ipv4 is not handled by dhclient by default (but uses klibc instead) hence the need to modify scripts.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package isc-dhcp - 4.3.5-3ubuntu1.1

---------------
isc-dhcp (4.3.5-3ubuntu1.1) zesty; urgency=medium

  * debian/initramfs-tools/lib/etc/dhcp/dhclient-enter-hooks.d/config: fix the
    logic for handling search domains to also write it to the output file when
    only the domain name is provided by the DHCP server. Copied code from
    debian/dhclient-script.linux. (LP: #1713747)

 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 29 Aug 2017 11:05:01 -0400

Changed in isc-dhcp (Ubuntu Zesty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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