]> www.infradead.org Git - users/jedix/linux-maple.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)
committerGuangyu Sun <guangyu.sun@oracle.com>
Mon, 8 Oct 2012 16:59:59 +0000 (09:59 -0700)
commit1d850afca1d2c813143b04366ad70fdd3bfcebc5
tree6943716187fb97a0777cafb3bbedda7b54c8db3b
parent7dcf6c038a5530cd05ca71ffe2993ff2595e6db3
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>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
net/sched/act_gact.c