0x7F char causes "Unable to parse DNS TXT" in powerdns-recursor #1727

Closed
mbevand opened this Issue Sep 24, 2014 · 8 comments

Comments

Projects
None yet
3 participants
@mbevand

mbevand commented Sep 24, 2014

When the latest powerdns-recursor version (3.6.1) attempts to resolve a TXT record containing the character 0x7F (DEL), it errors out (see error below). This is because 837f4b4 was an incomplete fix: "> 127" should be replaced with "> 126".

STL error: Unable to parse DNS TXT '"\x7f"'

@Habbie Habbie added rec defect labels Sep 25, 2014

@mbevand

This comment has been minimized.

Show comment
Hide comment
@mbevand

mbevand Oct 3, 2014

Any update? It is a one-line patch to fix this issue... I created a record to help you guys test and validate the fix. If x.x.x.x is a PowerDNS resolver run:

$ dig @x.x.x.x -t txt bug.zorinaq.com

Actual result: dig times out... and pdns_recursor logs show "Unable to parse DNS TXT '"\x7f"'

Expected result: dig showing:

; <<>> DiG 9.9.5-3-Ubuntu <<>> @x.x.x.x -t txt bug.zorinaq.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5858
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;bug.zorinaq.com. IN TXT

;; ANSWER SECTION:
bug.zorinaq.com. 299 IN TXT "\127"

[...]

mbevand commented Oct 3, 2014

Any update? It is a one-line patch to fix this issue... I created a record to help you guys test and validate the fix. If x.x.x.x is a PowerDNS resolver run:

$ dig @x.x.x.x -t txt bug.zorinaq.com

Actual result: dig times out... and pdns_recursor logs show "Unable to parse DNS TXT '"\x7f"'

Expected result: dig showing:

; <<>> DiG 9.9.5-3-Ubuntu <<>> @x.x.x.x -t txt bug.zorinaq.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5858
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;bug.zorinaq.com. IN TXT

;; ANSWER SECTION:
bug.zorinaq.com. 299 IN TXT "\127"

[...]

@txdv

This comment has been minimized.

Show comment
Hide comment
@txdv

txdv Oct 4, 2014

Your blog stated you had a patch. Where is the patch?

txdv commented Oct 4, 2014

Your blog stated you had a patch. Where is the patch?

@Habbie

This comment has been minimized.

Show comment
Hide comment
@Habbie

Habbie Oct 6, 2014

Member

The patch is described in the first post on this page.

Member

Habbie commented Oct 6, 2014

The patch is described in the first post on this page.

@Habbie

This comment has been minimized.

Show comment
Hide comment
@Habbie

Habbie Oct 6, 2014

Member

Bug confirmed in 3.5.3

Member

Habbie commented Oct 6, 2014

Bug confirmed in 3.5.3

@Habbie

This comment has been minimized.

Show comment
Hide comment
@Habbie

Habbie Oct 6, 2014

Member

Works for me on 3.6.1 though!

Can you verify that you really are running 3.6.1? Then, can you tell us exactly how you built it and on what system?

Member

Habbie commented Oct 6, 2014

Works for me on 3.6.1 though!

Can you verify that you really are running 3.6.1? Then, can you tell us exactly how you built it and on what system?

@mbevand

This comment has been minimized.

Show comment
Hide comment
@mbevand

mbevand Oct 6, 2014

As Habbie said, the patch is described in the first post on this page (replacing "> 127" with "> 126" at line 395 of this patch: 837f4b4).

I built 3.6.1 on Ubuntu 14.04 with a simple ./configure && make (and running pdns-recursor from the source tree.) Although it has been 2 weeks since I did it so I don't recall the exact details and did not take notes other than submitting this bug. I will double-check tonight my steps...

mbevand commented Oct 6, 2014

As Habbie said, the patch is described in the first post on this page (replacing "> 127" with "> 126" at line 395 of this patch: 837f4b4).

I built 3.6.1 on Ubuntu 14.04 with a simple ./configure && make (and running pdns-recursor from the source tree.) Although it has been 2 weeks since I did it so I don't recall the exact details and did not take notes other than submitting this bug. I will double-check tonight my steps...

@mbevand

This comment has been minimized.

Show comment
Hide comment
@mbevand

mbevand Oct 7, 2014

Hmm, I am indeed unable to reproduce it with 3.6.1. The bug only exists with 3.5.3. Something else must have changed in the logic causing 3.6.1 to work despite "> 127" in this if condition.

mbevand commented Oct 7, 2014

Hmm, I am indeed unable to reproduce it with 3.6.1. The bug only exists with 3.5.3. Something else must have changed in the logic causing 3.6.1 to work despite "> 127" in this if condition.

@Habbie

This comment has been minimized.

Show comment
Hide comment
@Habbie

Habbie Oct 7, 2014

Member

973efd3 fixed this. Closing ticket!

Member

Habbie commented Oct 7, 2014

973efd3 fixed this. Closing ticket!

@Habbie Habbie closed this Oct 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment