]> 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:01:10 +0000 (02:01 +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 cb06b2a97a5a2b110ab50b20f874f24786d6a04e..aa43710256e6aa64ca8607369d7743d4ff82adc4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
        --- 9.11.1rc3 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 51bf8d9ebd775021f4fd2609bb3c14df8bc5ebcb..329c2d9aba85cbdd30b0a9a91778bf3f29fa2220 100644 (file)
@@ -557,5 +557,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)