]> 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:00:17 +0000 (02:00 +1100)
                        (CVE-2017-3138) [RT #44924]

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

diff --git a/CHANGES b/CHANGES
index 0941a6667a4e09474ee4387ca416fcc3fc43106e..445e5e7adeb72af4c6cb09047d901678eef0165b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+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 139291e917bf3a9e2584aaad7df661f5433557b0..6e9740cffa83b33ecac35913ac4da4432356d136 100644 (file)
@@ -566,5 +566,13 @@ EOF
     status=`expr $status + $ret`
 fi
 
+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 bc4b653d1a568aa220378257ea342b0e6d8e960c..f78bdb20d8cc52e2f8861ad3850b658bd7f4b0d6 100644 (file)
@@ -145,8 +145,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 0f8ca532e313d87c86db5b83224cb44433d4bd86..bf7c0dde775a36ba2bf1a25a6b67045a9e0b9e27 100644 (file)
@@ -86,9 +86,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)