[Pkg-net-snmp-commits] [pkg-net-snmp] 01/02: fix CVE-2014-3565

Hideki Yamane henrich at moszumanska.debian.org
Wed Sep 17 07:02:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch squeeze
in repository pkg-net-snmp.

commit 138f4124836ab59544fb7af417b40192990cf9bc
Author: Hideki Yamane <henrich at debian.org>
Date:   Wed Sep 17 15:34:22 2014 +0900

    fix CVE-2014-3565
---
 debian/changelog                   |   8 +
 debian/patches/CVE-2014-3565.patch | 431 +++++++++++++++++++++++++++++++++++++
 debian/patches/series              |   1 +
 3 files changed, 440 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 45126a3..a76454a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+net-snmp (5.4.3~dfsg-2+squeeze3) UNRELEASED; urgency=medium
+
+  * debian/patches
+    - add CVE-2014-3565.patch taken from upstream to fix CVE-2014-3565
+      (Closes: #760132)
+
+ -- Hideki Yamane <henrich at debian.org>  Wed, 17 Sep 2014 15:30:30 +0900
+
 net-snmp (5.4.3~dfsg-2+squeeze2) oldstable-proposed-updates; urgency=high
 
   * Team upload.
diff --git a/debian/patches/CVE-2014-3565.patch b/debian/patches/CVE-2014-3565.patch
new file mode 100644
index 0000000..3f86b1c
--- /dev/null
+++ b/debian/patches/CVE-2014-3565.patch
@@ -0,0 +1,431 @@
+Index: pkg-net-snmp/snmplib/mib.c
+===================================================================
+--- pkg-net-snmp.orig/snmplib/mib.c	2014-09-17 15:31:55.935756953 +0900
++++ pkg-net-snmp/snmplib/mib.c	2014-09-17 15:32:14.779821910 +0900
+@@ -436,17 +436,16 @@
+     u_char         *cp;
+     int             output_format, len_needed;
+ 
+-    if ((var->type != ASN_OCTET_STR) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        const char      str[] = "Wrong Type (should be OCTET STRING): ";
+-        if (snmp_cstrcat
+-            (buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OCTET_STR) {
++        if (!netsnmp_ds_get_boolean(
++                    NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            const char      str[] = "Wrong Type (should be OCTET STRING): ";
++            if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+ 
+@@ -706,16 +705,16 @@
+                      const struct enum_list *enums,
+                      const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE_FLOAT) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                         "Wrong Type (should be Float): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OPAQUE_FLOAT) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Float): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -776,17 +775,16 @@
+                       const struct enum_list *enums,
+                       const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE_DOUBLE) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat
+-            (buf, buf_len, out_len, allow_realloc, 
+-             "Wrong Type (should be Double): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OPAQUE_DOUBLE) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Double): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -851,20 +849,21 @@
+ {
+     char            a64buf[I64CHARSZ + 1];
+ 
+-    if ((var->type != ASN_COUNTER64
++    if (var->type != ASN_COUNTER64
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+         && var->type != ASN_OPAQUE_COUNTER64
+         && var->type != ASN_OPAQUE_I64 && var->type != ASN_OPAQUE_U64
+ #endif
+-        ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                        "Wrong Type (should be Counter64): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++        ) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Counter64): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -952,23 +951,25 @@
+                       const struct enum_list *enums,
+                       const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_OPAQUE
++    if (var->type != ASN_OPAQUE
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+         && var->type != ASN_OPAQUE_COUNTER64
+         && var->type != ASN_OPAQUE_U64
+         && var->type != ASN_OPAQUE_I64
+         && var->type != ASN_OPAQUE_FLOAT && var->type != ASN_OPAQUE_DOUBLE
+ #endif                          /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+-        ) && (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        if (snmp_cstrcat(buf, buf_len, out_len, allow_realloc, 
+-                         "Wrong Type (should be Opaque): ")) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++        ) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Opaque): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
++
+ #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+     switch (var->type) {
+     case ASN_OPAQUE_COUNTER64:
+@@ -1044,17 +1045,16 @@
+ {
+     int             buf_overflow = 0;
+ 
+-    if ((var->type != ASN_OBJECT_ID) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] =
+-            "Wrong Type (should be OBJECT IDENTIFIER): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_OBJECT_ID) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be OBJECT IDENTIFIER): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1114,16 +1114,16 @@
+ {
+     char            timebuf[40];
+ 
+-    if ((var->type != ASN_TIMETICKS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be Timeticks): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_TIMETICKS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Timeticks): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS)) {
+@@ -1262,17 +1262,18 @@
+ {
+     char           *enum_string = NULL;
+ 
+-    if ((var->type != ASN_INTEGER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be INTEGER): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_INTEGER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be INTEGER): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
++
+     for (; enums; enums = enums->next) {
+         if (enums->value == *var->val.integer) {
+             enum_string = enums->label;
+@@ -1365,16 +1366,16 @@
+ {
+     char           *enum_string = NULL;
+ 
+-    if ((var->type != ASN_UINTEGER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be UInteger32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_UINTEGER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be UInteger32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     for (; enums; enums = enums->next) {
+@@ -1462,17 +1463,16 @@
+ {
+     char            tmp[32];
+ 
+-    if ((var->type != ASN_GAUGE) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] =
+-            "Wrong Type (should be Gauge32 or Unsigned32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_GAUGE) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Gauge32 or Unsigned32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1535,16 +1535,16 @@
+ {
+     char            tmp[32];
+ 
+-    if ((var->type != ASN_COUNTER) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be Counter32): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_COUNTER) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be Counter32): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1598,16 +1598,16 @@
+ {
+     size_t          i;
+ 
+-    if ((var->type != ASN_IPADDRESS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NetworkAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_IPADDRESS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NetworkAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1664,16 +1664,16 @@
+ {
+     u_char         *ip = var->val.string;
+ 
+-    if ((var->type != ASN_IPADDRESS) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be IpAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_IPADDRESS) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be IpAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1722,20 +1722,20 @@
+                     const struct enum_list *enums,
+                     const char *hint, const char *units)
+ {
+-    if ((var->type != ASN_NULL) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NULL): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_NULL) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NULL): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+-    } else {
+-        u_char          str[] = "NULL";
+-        return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+     }
++
++    u_char          str[] = "NULL";
++    return snmp_strcat(buf, buf_len, out_len, allow_realloc, str);
+ }
+ 
+ 
+@@ -1770,16 +1770,16 @@
+     u_char         *cp;
+     char           *enum_string;
+ 
+-    if ((var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) &&
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be BITS): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_BIT_STR && var->type != ASN_OCTET_STR) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be BITS): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
+@@ -1854,16 +1854,16 @@
+                            const struct enum_list *enums, const char *hint,
+                            const char *units)
+ {
+-    if ((var->type != ASN_NSAP) && 
+-        (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT))) {
+-        u_char          str[] = "Wrong Type (should be NsapAddress): ";
+-        if (snmp_strcat(buf, buf_len, out_len, allow_realloc, str)) {
+-            return sprint_realloc_by_type(buf, buf_len, out_len,
++    if (var->type != ASN_NSAP) {
++        if (!netsnmp_ds_get_boolean(
++                NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICKE_PRINT)) {
++            u_char          str[] = "Wrong Type (should be NsapAddress): ";
++            if (!snmp_strcat(buf, buf_len, out_len, allow_realloc, str))
++                return 0;
++        }
++        return sprint_realloc_by_type(buf, buf_len, out_len,
+                                           allow_realloc, var, NULL, NULL,
+                                           NULL);
+-        } else {
+-            return 0;
+-        }
+     }
+ 
+     if (!netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_QUICK_PRINT)) {
diff --git a/debian/patches/series b/debian/patches/series
index cea77ce..7afafe1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ CVE-2012-2141.patch
 TrapReceiver.patch
 67_CVE-2014-2310.patch
 agentx-crash.patch
+CVE-2014-3565.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-net-snmp/pkg-net-snmp.git



More information about the Pkg-net-snmp-commits mailing list