Code

patches/CVE-2016-6254.dpatch: Fix heap overflow in the network plugin.
authorSebastian Harl <sh@tokkee.org>
Wed, 27 Jul 2016 08:20:37 +0000 (10:20 +0200)
committerSebastian Harl <sh@tokkee.org>
Wed, 27 Jul 2016 08:20:37 +0000 (10:20 +0200)
Emilien Gaspar has identified a heap overflow in parse_packet(), the function
used by the network plugin to parse incoming network packets.

Thanks to Florian Forster for reporting the bug in Debian.
Closes: #832507, CVE-2016-6254
debian/changelog
debian/patches/00list
debian/patches/CVE-2016-6254.dpatch [new file with mode: 0644]

index ba1e1d6659253db570ba7103a9eb5940cfbe5b9d..aa6a82c589d2be938665a21ea8b2187a4150de26 100644 (file)
@@ -1,3 +1,13 @@
+collectd (5.1.0-3+deb7u1) UNRELEASED; urgency=high
+
+  * debian/patches/CVE-2016-6254.dpatch: Fix heap overflow in the network
+    plugin. Emilien Gaspar has identified a heap overflow in parse_packet(),
+    the function used by the network plugin to parse incoming network packets.
+    Thanks to Florian Forster for reporting the bug in Debian.
+    (Closes: #832507, CVE-2016-6254)
+
+ -- Sebastian Harl <tokkee@debian.org>  Wed, 27 Jul 2016 10:14:42 +0200
+
 collectd (5.1.0-3) unstable; urgency=low
 
   * debian/patches/migrate-4-5-df.dpatch, debian/collectd-core.postinst:
index 390f00fb1aa3cb7a06b5310b837ac85a035c15d2..5862f1682a65b5c517d4eaadf8e71ebfca7a5536 100644 (file)
@@ -1,3 +1,4 @@
+CVE-2016-6254.dpatch
 rrd_filter_path.dpatch
 collection_conf_path.dpatch
 bts559801_plugin_find_fix.dpatch
diff --git a/debian/patches/CVE-2016-6254.dpatch b/debian/patches/CVE-2016-6254.dpatch
new file mode 100644 (file)
index 0000000..44cdc01
--- /dev/null
@@ -0,0 +1,45 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## CVE-2016-6254.dpatch by Florian Forster <octo@collectd.org>
+##
+## DP: network plugin: Fix heap overflow in parse_packet().
+## DP:
+## DP: Emilien Gaspar has identified a heap overflow in parse_packet(), the
+## DP: function used by the network plugin to parse incoming network packets.
+## DP:
+## DP: This is a vulnerability in collectd, though the scope is not clear at
+## DP: this point. At the very least specially crafted network packets can be
+## DP: used to crash the daemon. We can't rule out a potential remote code
+## DP: execution though.
+## DP:
+## DP: Fixes: CVE-2016-6254
+## DP:
+## DP: Upstream commit:
+## DP: https://github.com/collectd/collectd/commit/b589096
+
+diff a/src/network.c b/src/network.c
+--- a/src/network.c
++++ b/src/network.c
+@@ -1392,6 +1392,7 @@
+                               printed_ignore_warning = 1;
+                       }
+                       buffer = ((char *) buffer) + pkg_length;
++                      buffer_size -= (size_t) pkg_length;
+                       continue;
+               }
+ #endif /* HAVE_LIBGCRYPT */
+@@ -1419,6 +1420,7 @@
+                               printed_ignore_warning = 1;
+                       }
+                       buffer = ((char *) buffer) + pkg_length;
++                      buffer_size -= (size_t) pkg_length;
+                       continue;
+               }
+ #endif /* HAVE_LIBGCRYPT */
+@@ -1560,6 +1562,7 @@
+                       DEBUG ("network plugin: parse_packet: Unknown part"
+                                       " type: 0x%04hx", pkg_type);
+                       buffer = ((char *) buffer) + pkg_length;
++                      buffer_size -= (size_t) pkg_length;
+               }
+       } /* while (buffer_size > sizeof (part_header_t)) */