aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorstephen hemminger <stephen@networkplumber.org>2013-08-01 22:32:07 -0700
committerBen Hutchings <ben@decadent.org.uk>2013-10-26 21:05:55 +0100
commit746db946cde024822904dbe590b43cae7589ad30 (patch)
tree325411346510106110976dcd77c635487dd5e587 /net/sched
parentc3f403c243a408dd7eeb1ff5cb59e60f5557c9b2 (diff)
downloadkernel_samsung_smdk4412-746db946cde024822904dbe590b43cae7589ad30.zip
kernel_samsung_smdk4412-746db946cde024822904dbe590b43cae7589ad30.tar.gz
kernel_samsung_smdk4412-746db946cde024822904dbe590b43cae7589ad30.tar.bz2
htb: fix sign extension bug
[ Upstream commit cbd375567f7e4811b1c721f75ec519828ac6583f ] 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/sched')
-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 f08b9166..caa5aff 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -86,7 +86,7 @@ struct htb_class {
unsigned int children;
struct htb_class *parent; /* parent class */
- int prio; /* these two are used only by leaves... */
+ u32 prio; /* these two are used only by leaves... */
int quantum; /* but stored for parent-to-leaf return */
union {