aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2013-08-02 01:32:07 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-02 17:52:20 -0400
commitcbd375567f7e4811b1c721f75ec519828ac6583f (patch)
treeaf09c22cc7ee9adb1d3758c07cd2ceabcc50b781
parent787381415cf967c5d6d1d7c5b5bd893376945edd (diff)
htb: fix sign extension bug
When userspace passes a large priority value the assignment of the unsigned value hopt->prio to signed int cl->prio causes cl->prio to become negative and the comparison is with TC_HTB_NUMPRIO is always false. The result is that HTB crashes by referencing outside the array when processing packets. With this patch the large value wraps around like other values outside the normal range. See: https://bugzilla.kernel.org/show_bug.cgi?id=60669 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/sch_htb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index c2124ea29f45..45e751527dfc 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -100,7 +100,7 @@ struct htb_class {
100 struct psched_ratecfg ceil; 100 struct psched_ratecfg ceil;
101 s64 buffer, cbuffer;/* token bucket depth/rate */ 101 s64 buffer, cbuffer;/* token bucket depth/rate */
102 s64 mbuffer; /* max wait time */ 102 s64 mbuffer; /* max wait time */
103 int prio; /* these two are used only by leaves... */ 103 u32 prio; /* these two are used only by leaves... */
104 int quantum; /* but stored for parent-to-leaf return */ 104 int quantum; /* but stored for parent-to-leaf return */
105 105
106 struct tcf_proto *filter_list; /* class attached filters */ 106 struct tcf_proto *filter_list; /* class attached filters */