lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080522002155.GP20815@postel.suug.ch>
Date:	Thu, 22 May 2008 02:21:55 +0200
From:	Thomas Graf <tgraf@...g.ch>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	Dave Jones <davej@...emonkey.org.uk>, netdev@...r.kernel.org
Subject: Re: Fwd: [Bug 447812] New: Netlink messages from "tc"  to sch_netem module are not interpreted correctly

* Stephen Hemminger <shemminger@...tta.com> 2008-05-21 15:10
> /sbin/tc qdisc del dev eth1 root
> /sbin/tc qdisc del dev eth1 ingress
> /sbin/tc qdisc add dev eth1 root handle 1: prio bands 5 priomap 4 4 4 4 
> 4 4 4 4 4 4 4 4 4 4 4 4
> /sbin/tc qdisc add dev eth1 parent 1:1 handle 10: netem
> /sbin/tc qdisc add dev eth1 parent 10:1 handle 100: tbf rate 2147483647 
> burst 1600 latency 2000000 mpu 64
> /sbin/tc qdisc change dev eth1 parent 1:1 handle 10: netem delay 50ms 
> 5ms 10% corrupt 8%
> 
> It also generates the warning if the last line of the above is simply:
> 
> /sbin/tc qdisc change dev eth1 parent 1:1 handle 10: netem delay 50ms 
> 5ms 10%
> 
> But not if that last line is (i.e. with the correlation part dropped.)
> 
> /sbin/tc qdisc change dev eth1 parent 1:1 handle 10: netem delay 50ms 5ms
> 
> So, all in all, it seems to me that a bug has crept into the kernel 
> interpretation of the netem netlink messages.

Could you try this patch?

Index: net-2.6/include/net/netlink.h
===================================================================
--- net-2.6.orig/include/net/netlink.h	2008-05-22 02:12:48.000000000 +0200
+++ net-2.6/include/net/netlink.h	2008-05-22 02:15:25.000000000 +0200
@@ -772,12 +772,13 @@
 					    const struct nla_policy *policy,
 					    int len)
 {
-	if (nla_len(nla) < len)
+	int nested_len = nla_len(nla) - NLA_ALIGN(len);
+
+	if (nested_len < 0)
 		return -1;
-	if (nla_len(nla) >= NLA_ALIGN(len) + sizeof(struct nlattr))
-		return nla_parse_nested(tb, maxtype,
-					nla_data(nla) + NLA_ALIGN(len),
-					policy);
+	if (nested_len >= nla_attr_size(0))
+		return nla_parse(tb, maxtype, nla_data(nla) + NLA_ALIGN(len),
+				 nested_len, policy);
 	memset(tb, 0, sizeof(struct nlattr *) * (maxtype + 1));
 	return 0;
 }
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ