Bug 1826691 - dnsmasq cannot forward DNS reply without qname
Summary: dnsmasq cannot forward DNS reply without qname
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: dnsmasq
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Menšík
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1826709
TreeView+ depends on / blocked
 
Reported: 2020-04-22 10:48 UTC by Petr Menšík
Modified: 2021-11-30 16:34 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1826709 (view as bug list)
Environment:
Last Closed: 2021-11-30 16:34:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
basic reproducer script (661 bytes, text/plain)
2020-04-22 10:56 UTC, Petr Menšík
no flags Details
all-on-one-test.sh (1019 bytes, application/x-shellscript)
2020-04-22 11:38 UTC, Petr Menšík
no flags Details
Candidate patch (2.25 KB, patch)
2020-04-22 11:42 UTC, Petr Menšík
no flags Details | Diff

Description Petr Menšík 2020-04-22 10:48:52 UTC
Description of problem:
dnsmasq is not able to deliver response to client, if configured upstream forwarder replies just with status code and no QNAME section present.

Unbound 1.6.6 sends such reply, when non-recursive query is sent to it. If dnsmasq is forwarding to it, it will not deliver SERVFAIL or original response, it would just timeout.

Version-Release number of selected component (if applicable):
dnsmasq-2.80-13.fc30.x86_64

How reproducible:
always

Steps to Reproduce:
1. configure forwarder to reply without qname, reply size 12
2. set dnsmasq --server=[forwarder-ip]
3. dig @[dnsmasq-ip] some.example.com

Actual results:
; <<>> DiG 9.16.2-RedHat-9.16.2-1.fc30 <<>> -p 5354 @127.0.0.1 +norec nx.example.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached


Expected results:
status: SERVFAIL or exact response from the server


Additional info:

Comment 1 Petr Menšík 2020-04-22 10:56:44 UTC
Created attachment 1680830 [details]
basic reproducer script

On localhost, unbound is supposed to run. When it replies without qname in response, this dig in this script timeouts. It should receive at least SERVFAIL.

Alternative would be ldns-utils package.

cat > testns << TESTNS
$TTL 600

ENTRY_BEGIN
MATCH #nx.test
REPLY SERVFAIL QR
ADJUST copy_id
ENTRY_END
TESTNS

ldns-testns testns

Then run this script

Comment 2 Petr Menšík 2020-04-22 11:09:19 UTC
Unbound 1.6.6 from RHEL/CentOS 7 would return REFUSED when dig +norec is directed at default configuration. That reply is without qname. Qname was fixed in unbound 1.7.0, later versions answers are properly forwarded.

Comment 3 Petr Menšík 2020-04-22 11:38:24 UTC
Created attachment 1680836 [details]
all-on-one-test.sh

Updated reproducer, starting also ldns-testns on test. It provides complete check if dnsmasq is able to handle replies without qname.

Comment 4 Petr Menšík 2020-04-22 11:40:40 UTC
Reply without qname looks like this in DiG:

$ dig -p 8054 test

; <<>> DiG 9.16.2-RedHat-9.16.2-1.fc30 <<>> -p 8054 test
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29465
;; flags: qr; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; Query time: 0 msec
;; SERVER: 127.0.0.1#8054(127.0.0.1)
;; WHEN: St dub 22 13:39:36 CEST 2020
;; MSG SIZE  rcvd: 12

Comment 5 Petr Menšík 2020-04-22 11:42:45 UTC
Created attachment 1680837 [details]
Candidate patch

Comment 7 Ben Cotton 2020-08-11 13:19:49 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 8 Ben Cotton 2021-11-04 17:22:50 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
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 '33'.

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 33 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 9 Ben Cotton 2021-11-30 16:34:25 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 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.