]> git.baikalelectronics.ru Git - kernel.git/commit
htb: fix sign extension bug
authorstephen hemminger <stephen@networkplumber.org>
Fri, 2 Aug 2013 05:32:07 +0000 (22:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Aug 2013 21:52:20 +0000 (14:52 -0700)
commit61b4a6689314e244c94266ce4dc528f940afb63c
treeaf09c22cc7ee9adb1d3758c07cd2ceabcc50b781
parentca6186aa3d4f8b16fdd174e9e90ea5bd7f3e4ed4
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>
net/sched/sch_htb.c