Bug 2177075

Summary: with any IPv4 loopback address as resolver on the host, passt forwards DNS queries to 127.0.0.1 instead of original loopback address
Product: Red Hat Enterprise Linux 9 Reporter: Stefano Brivio <sbrivio>
Component: passtAssignee: Stefano Brivio <sbrivio>
Status: CLOSED ERRATA QA Contact: Lei Yang <leiyang>
Severity: high Docs Contact:
Priority: medium    
Version: 9.2CC: chayang, jinzhao, juzhang, pvlasin, zhguo
Target Milestone: rcKeywords: Triaged
Target Release: 9.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: passt-0^20230222.g4ddbcb9-2.el9_2 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2179035 (view as bug list) Environment:
Last Closed: 2023-05-09 07:43:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2179035    

Description Stefano Brivio 2023-03-09 21:14:07 UTC
Seen with a Fedora 37 guest on a Fedora 37 host, with systemd-resolved handling DNS resolution in both:

- the IPv4 resolver listed in /etc/resolv.conf is 127.0.0.53 on both host and guest

- passt advertises the address of the default gateway, via DHCP, as DNS resolver (because that's the only way 127.0.0.53 on the host can be reached)

- the guest sends a DNS query to the address of the default gateway

- passt forwards it to 127.0.0.1 (not 127.0.0.53) and it doesn't receive a reply. DNS resolution fails altogether in the guest

This didn't happen with Fedora 36 and it only started happening recently on Fedora 37 -- I guess systemd-resolved also accepted queries to 127.0.0.1 until some point in time. I also couldn't see an issue like this on RHEL 9.

However, passt is forwarding DNS queries to the wrong (IPv4 loopback) address, which is rather critical: we shouldn't rely on a particular host configuration for DNS resolution to work.

We need these commits from upstream:

  https://passt.top/passt/commit/?id=ddf7097a718095e879428667f2d56ec7d4f027e5
  udp: Actually use host resolver to forward DNS queries

  https://passt.top/passt/commit/?id=8ca907a3f0a095691cdaf56ad610fd802df88146
  conf: Split add_dns{4,6}() out of get_dns()

  https://passt.top/passt/commit/?id=bad252687271c0255f6a077f19cbc19aa0427f8d
  conf, udp: Allow any loopback address to be used as resolver

Comment 19 errata-xmlrpc 2023-05-09 07:43:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (passt bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2292