]> git.karo-electronics.de Git - karo-tx-linux.git/commit
net_sched: gact: Fix potential panic in tcf_gact().
authorHiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Fri, 3 Aug 2012 10:57:52 +0000 (19:57 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Oct 2012 16:47:05 +0000 (09:47 -0700)
commitd5916dedd20a1714a8436f51ba4df13bd4c56474
tree9b90289de4dc3b03bfc018609b93e491c84faaa8
parent09c403dc7c8e73a4f9c553e4d84aef68af25ff65
net_sched: gact: Fix potential panic in tcf_gact().

[ Upstream commit 696ecdc10622d86541f2e35cc16e15b6b3b1b67e ]

gact_rand array is accessed by gact->tcfg_ptype whose value
is assumed to less than MAX_RAND, but any range checks are
not performed.

So add a check in tcf_gact_init(). And in tcf_gact(), we can
reduce a branch.

Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/act_gact.c