]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4582. [security] 'rndc ""' could trigger a assertion failure in named.
authorMark Andrews <marka@isc.org>
Fri, 24 Mar 2017 15:00:17 +0000 (02:00 +1100)
committerMark Andrews <marka@isc.org>
Fri, 24 Mar 2017 15:05:09 +0000 (02:05 +1100)
                        (CVE-2017-3138) [RT #44924]

(cherry picked from commit 8e8dfc5941e2375f2f8dadf3706258dd0db5f2e6)

CHANGES
bin/tests/system/rndc/tests.sh
lib/isc/include/isc/lex.h
lib/isc/lex.c

diff --git a/CHANGES b/CHANGES
index 1c8ed305457305b359710ac6fca5f03e451f9ae8..708d33cb3ebd828a763ba6799f870f38444d1743 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
        --- 9.10.5rc3 released ---
 
+4582.  [security]      'rndc ""' could trigger a assertion failure in named.
+                       (CVE-2017-3138) [RT #44924]
+
 4581.  [port]          Linux: Add getpid and getrandom to the list of system
                        calls named uses for seccomp. [RT #44883]
 
index a1c02fa4e886b09359c936b496c81476e1256a23..1ede9ca8d1b42ce141503e3de47e2555273ceb3a 100644 (file)
@@ -434,5 +434,13 @@ grep "received control channel command 'null with extra arguments'" ns2/named.ru
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo "I:check 'rndc \"\"' is handled ($n)"
+ret=0
+$RNDCCMD "" > rndc.out.test$n 2>&1 && ret=1
+grep "rndc: '' failed: failure" rndc.out.test$n > /dev/null
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 [ $status -eq 0 ] || exit 1
index 8612150991bc8ca5affe8acb7d80a71a6bf66305..81af3af17afed8d77cf3af9e35bf834a2c807d02 100644 (file)
@@ -152,8 +152,6 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp);
  * Requires:
  *\li  '*lexp' is a valid lexer.
  *
- *\li  max_token > 0.
- *
  * Ensures:
  *\li  On success, *lexp is attached to the newly created lexer.
  *
index ce1c5599412fd56a79db1e505726e5552834404e..fa6e03fed826260ef31c9a084e0f4986aaac9297 100644 (file)
@@ -94,9 +94,10 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) {
        /*
         * Create a lexer.
         */
-
        REQUIRE(lexp != NULL && *lexp == NULL);
-       REQUIRE(max_token > 0U);
+
+       if (max_token == 0U)
+               max_token = 1;
 
        lex = isc_mem_get(mctx, sizeof(*lex));
        if (lex == NULL)