From 07902d9f9d2d7eac5aa722237f863ac6745bb1d8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 18 Feb 2021 16:56:51 +1100 Subject: [PATCH 1/4] Test a LOC record with an invalid direction field --- lib/dns/tests/rdata_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dns/tests/rdata_test.c b/lib/dns/tests/rdata_test.c index 9cf32c2849..877660f67d 100644 --- a/lib/dns/tests/rdata_test.c +++ b/lib/dns/tests/rdata_test.c @@ -2017,6 +2017,7 @@ loc(void **state) { TEXT_INVALID("90 0 1 S 180 W 0"), TEXT_INVALID("90 S 180 1 W 0"), TEXT_INVALID("90 S 180 0 1 W 0"), + TEXT_INVALID("0 0 0.000 E 0 0 0.000 E -0.95m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -0.95m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -0.05m 1m 10000m 10m"), TEXT_VALID("0 0 0.000 N 0 0 0.000 E -100000.00m 1m 10000m 10m"), From 009358d77d68ea6ad90702a951483beb11717c00 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 18 Feb 2021 16:57:28 +1100 Subject: [PATCH 2/4] Correctly detect when get_direction failed --- lib/dns/rdata/generic/loc_29.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index 5ab231cb93..478723ae6c 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -242,7 +242,7 @@ loc_getcoordinate(isc_lex_t *lexer, unsigned long *dp, unsigned long *mp, * Direction. */ RETERR(get_direction(lexer, &token, directions, &direction)); - if (direction == -1) { + if (direction == 0) { RETERR(DNS_R_SYNTAX); } done: From 6f47e0956ccb9f02e40875b864c780565a816160 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 18 Feb 2021 16:59:57 +1100 Subject: [PATCH 3/4] Add CHANGES for [GL #2499] --- CHANGES | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 60ba9d5311..5161697276 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5586. [bug] An invalid direction field in a LOC record resulted in + an INSIST failure. [GL #2499] + 5585. [func] Implementations of memory contexts and memory pools were refactored to reduce lock contention for shared memory contexts by replacing mutexes with atomic operations. From 3d340ecfd2f4a703608a001c6821949b534c9312 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 18 Feb 2021 17:02:27 +1100 Subject: [PATCH 4/4] Add release note for [GL #2499] --- doc/notes/notes-current.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/notes/notes-current.rst b/doc/notes/notes-current.rst index 9fdc8fd32b..508fbb0226 100644 --- a/doc/notes/notes-current.rst +++ b/doc/notes/notes-current.rst @@ -48,3 +48,6 @@ Bug Fixes of sending a proper response back. Rollback setting the IP_DONTFRAG on the UDP sockets that we enabled during the DNS Flag Day 2020 to fix this issue. [GL #2487] + +- An invalid direction field (not one of 'N'/'S' or 'E'/'W') in a LOC record + triggered an INSIST failure. [GL #2499]