Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALATqHnJosLVd71_heHmiKqctO5y=GYC+Nf9_gh-hoLk0nQEeQ@mail.gmail.com>
Date: Tue, 31 May 2022 12:24:19 +0200
From: Sascha Braun <sascha.braun.lpz@...glemail.com>
To: musl@...ts.openwall.com
Subject: Problably Issue in name_from_dns // __res_msend_rc (lookup_name.c)

Hi everyone,

I'm implementing a socket protocol with similar works to Emscripten - ok:

Here's what I noticed

- resolv.conf using multiple DNS servers
options timeout:22 attempts:5
nameserver 8.8.4.4
nameserver 208.67.222.222
nameserver 9.9.9.9
nameserver 1.1.1.1

- getaddrinfo with no hints, so that IPV6 and IPV4 is resolved
void socketstest1_client_dnsonly(void) {

struct addrinfo hints, * res;
memset(&hints, 0, sizeof(hints));
printf("begin lookup1...\n");
if (getaddrinfo("www.web.de", "80", &hints, &res) != 0) {
perror("getaddrinfo1");
}
printf("begin lookup2...\n");
if (getaddrinfo("www.google.de", "80", &hints, &res) != 0) {
perror("getaddrinfo2");
}
printf("begin lookup3...\n");
if (getaddrinfo("www.google.com", "80", &hints, &res) != 0) {
perror("getaddrinfo3");
}

}

When repeating socketstest1_client_dnsonly often, it appears that IPV6
answers for IPV4 requests to another server [or vice-versa] responses can
get mixed up and getaddrinfo reports sometimes only an error where none is.

Below is a console dump of my test where you see the critical situation
(end)
8.8.4.4:53 was queried, 9.9.9.9:53 responded for a (different IP Proto),
resulting in error getaddrinfo1: Address in use

This happens in about 1/100 tests. When you specify IPV4 or IPV6 in hints,
this issue does NOT show up.
Many Thanks
Sascha

Console Data Dump:

__syscall_recv begin EP[8.8.4.4:53]
__syscall_recv'd_internal [020000350808040400000000000000008.8.4.4:53]
f79e818000010001000000000377777706676f6f676c6503636f6d00001c0001c00c001c00010000004800102a0014504001081200000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
connect:0200ffff8efaba240000000000000000
connect:0a00ffff000000002a00145040010812000000000000200400000000
begin lookup1...
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
08740100000100000000000003777777037765620264650000010001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
08740100000100000000000003777777037765620264650000010001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
08740100000100000000000003777777037765620264650000010001
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
087401000001000000000000037777770377656202646500001c0001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
087401000001000000000000037777770377656202646500001c0001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
087401000001000000000000037777770377656202646500001c0001
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000009.9.9.9:53]
08748180000100020000000003777777037765620264650000010001c00c000500010000011a000f0377777708672d68612d776562c014c028000100010000000c000452a5e58a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
recv: no data
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000009.9.9.9:53]
087481800001000100010000037777770377656202646500001c0001c00c00050001000000fb000f0377777708672d68612d776562c014c02c00060001000000210031036e733102706f0675692d646e73c0140a686f73746d6173746572c04378860f1200002a3000000e1000093a800000003c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
begin lookup2...
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
4920010000010000000000000377777706676f6f676c650264650000010001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
4920010000010000000000000377777706676f6f676c650264650000010001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
4920010000010000000000000377777706676f6f676c650264650000010001
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
4920010000010000000000000377777706676f6f676c6502646500001c0001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
4920010000010000000000000377777706676f6f676c6502646500001c0001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
4920010000010000000000000377777706676f6f676c6502646500001c0001
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000008.8.4.4:53]
4920818000010001000000000377777706676f6f676c650264650000010001c00c00010001000000b200048efabaa3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__syscall_recv begin EP[8.8.4.4:53]
__syscall_recv'd_internal [020000350808040400000000000000009.9.9.9:53]
4920818000010001000000000377777706676f6f676c650264650000010001c00c00010001000000ad00048efab9e3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
begin lookup3...
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
9308010000010000000000000377777706676f6f676c6503636f6d0000010001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
9308010000010000000000000377777706676f6f676c6503636f6d0000010001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
9308010000010000000000000377777706676f6f676c6503636f6d0000010001
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
9308010000010000000000000377777706676f6f676c6503636f6d00001c0001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
9308010000010000000000000377777706676f6f676c6503636f6d00001c0001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
9308010000010000000000000377777706676f6f676c6503636f6d00001c0001
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000009.9.9.9:53]
9308818000010001000000000377777706676f6f676c6503636f6d0000010001c00c000100010000009f00048efab9440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
recv: no data
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000009.9.9.9:53]
9308818000010001000000000377777706676f6f676c6503636f6d00001c0001c00c001c00010000002400102a0014504001082900000000000020040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
connect:0200ffff8efab9440000000000000000
connect:0a00ffff000000002a00145040010829000000000000200400000000
begin lookup1...
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
dcf00100000100000000000003777777037765620264650000010001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
dcf00100000100000000000003777777037765620264650000010001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
dcf00100000100000000000003777777037765620264650000010001
__syscall_send_internal 020000350808040400000000000000008.8.4.4:53]
dcf001000001000000000000037777770377656202646500001c0001
__syscall_send_internal 02000035d043dede0000000000000000208.67.222.222:53]
dcf001000001000000000000037777770377656202646500001c0001
__syscall_send_internal 020000350909090900000000000000009.9.9.9:53]
dcf001000001000000000000037777770377656202646500001c0001
__syscall_recv begin EP[0.0.0.0:0]
__syscall_recv'd_internal [020000000000000000000000000000008.8.4.4:53]
dcf081800001000100010000037777770377656202646500001c0001c00c00050001000000fa000f0377777708672d68612d776562c014c02c000600010000000f0031036e733102706f0675692d646e73c0140a686f73746d6173746572c04378860f1200002a3000000e1000093a800000003c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__syscall_recv begin EP[8.8.4.4:53]
__syscall_recv'd_internal [020000350808040400000000000000009.9.9.9:53]
dcf081800001000100010000037777770377656202646500001c0001c00c0005000100000129000f0377777708672d68612d776562c014c02c000600010000000e0031036e733102706f0675692d646e73c0140a686f73746d6173746572c04378860f1200002a3000000e1000093a800000003c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
getaddrinfo1: Address in use

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.