[arch-commits] Commit in iproute2/trunk (PKGBUILD tc.patch)

Ronald van Haren ronald at archlinux.org
Thu May 21 11:56:33 UTC 2015


    Date: Thursday, May 21, 2015 @ 13:56:32
  Author: ronald
Revision: 239608

upgpkg: iproute2 4.0.0-2

add upstream patch for FS#45031: tc qdisc show broken

Added:
  iproute2/trunk/tc.patch
Modified:
  iproute2/trunk/PKGBUILD

----------+
 PKGBUILD |   12 +++++++++---
 tc.patch |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-05-21 07:42:07 UTC (rev 239607)
+++ PKGBUILD	2015-05-21 11:56:32 UTC (rev 239608)
@@ -4,7 +4,7 @@
 
 pkgname=iproute2
 pkgver=4.0.0
-pkgrel=1
+pkgrel=2
 pkgdesc="IP Routing Utilities"
 arch=('i686' 'x86_64')
 license=('GPL2')
@@ -22,11 +22,13 @@
 validpgpkeys=('9F6FC345B05BE7E766B83C8F80A77F6095CDE47E') # Stephen Hemminger
 source=("http://www.kernel.org/pub/linux/utils/net/${pkgname}/${pkgname}-${pkgver}.tar."{xz,sign}
         iproute2-fhs.patch
-        unwanted-link-help.patch)
+        unwanted-link-help.patch
+	tc.patch)
 sha1sums=('d24385ae619966d1bd71e146322d6035d60aaa1a'
           'SKIP'
           '35b8cf2dc94b73eccad427235c07596146cd6f6c'
-          '3b1335f4025f657f388fbf4e5a740871e3129c2a')
+          '3b1335f4025f657f388fbf4e5a740871e3129c2a'
+          '81124e20802ff06bad616debab827b03a3c75679')
 
 prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
@@ -37,8 +39,12 @@
   # allow operations on links called "h", "he", "hel", "help"
   patch -Np1 -i "${srcdir}/unwanted-link-help.patch"
 
+  # upstream patch for FS#45031: tc qdisc show broken
+  patch -Np1 -i "${srcdir}/tc.patch"
+
   # do not treat warnings as errors
   sed -i 's/-Werror//' Makefile
+
 }
 
 build() {

Added: tc.patch
===================================================================
--- tc.patch	                        (rev 0)
+++ tc.patch	2015-05-21 11:56:32 UTC (rev 239608)
@@ -0,0 +1,58 @@
+From 46679bbbe89699016d31486de7599590d02a5054 Mon Sep 17 00:00:00 2001
+From: Vadim Kochan <vadim4j at gmail.com>
+Date: Mon, 20 Apr 2015 08:33:32 +0300
+Subject: tc util: Fix possible buffer overflow when print class id
+
+Use correct handle buffer length.
+
+Signed-off-by: Vadim Kochan <vadim4j at gmail.com>
+
+diff --git a/tc/tc_util.c b/tc/tc_util.c
+index 1d3153d..dc2b70f 100644
+--- a/tc/tc_util.c
++++ b/tc/tc_util.c
+@@ -128,30 +128,31 @@ ok:
+ 	return 0;
+ }
+ 
+-int print_tc_classid(char *buf, int len, __u32 h)
++int print_tc_classid(char *buf, int blen, __u32 h)
+ {
+-	char handle[40] = {};
++	SPRINT_BUF(handle) = {};
++	int hlen = SPRINT_BSIZE - 1;
+ 
+ 	if (h == TC_H_ROOT)
+ 		sprintf(handle, "root");
+ 	else if (h == TC_H_UNSPEC)
+-		snprintf(handle, len, "none");
++		snprintf(handle, hlen, "none");
+ 	else if (TC_H_MAJ(h) == 0)
+-		snprintf(handle, len, ":%x", TC_H_MIN(h));
++		snprintf(handle, hlen, ":%x", TC_H_MIN(h));
+ 	else if (TC_H_MIN(h) == 0)
+-		snprintf(handle, len, "%x:", TC_H_MAJ(h) >> 16);
++		snprintf(handle, hlen, "%x:", TC_H_MAJ(h) >> 16);
+ 	else
+-		snprintf(handle, len, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
++		snprintf(handle, hlen, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
+ 
+ 	if (use_names) {
+ 		char clname[IDNAME_MAX] = {};
+ 
+ 		if (id_to_name(cls_names, h, clname))
+-			snprintf(buf, len, "%s#%s", clname, handle);
++			snprintf(buf, blen, "%s#%s", clname, handle);
+ 		else
+-			snprintf(buf, len, "%s", handle);
++			snprintf(buf, blen, "%s", handle);
+ 	} else {
+-		snprintf(buf, len, "%s", handle);
++		snprintf(buf, blen, "%s", handle);
+ 	}
+ 
+ 	return 0;
+-- 
+cgit v0.10.2
+
+



More information about the arch-commits mailing list