diff options
author | Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> | 2012-08-06 07:45:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-06 22:30:01 +0200 |
commit | 47fd92f5a76eb3f5b407773766e7d7fa1a179419 (patch) | |
tree | fbebbe0628917989117a97ddf5737ceda816bccf /net/sched/act_ipt.c | |
parent | ip: fix error handling in ip_finish_output2() (diff) | |
download | linux-47fd92f5a76eb3f5b407773766e7d7fa1a179419.tar.xz linux-47fd92f5a76eb3f5b407773766e7d7fa1a179419.zip |
net_sched: act: Delete estimator in error path.
Some action modules free struct tcf_common in their error path
while estimator is still active. This results in est_timer()
dereference freed memory.
Add gen_kill_estimator() in ipt, pedit and simple action.
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/act_ipt.c')
-rw-r--r-- | net/sched/act_ipt.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index 60e281ad0f07..58fb3c7aab9e 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c @@ -185,7 +185,12 @@ err3: err2: kfree(tname); err1: - kfree(pc); + if (ret == ACT_P_CREATED) { + if (est) + gen_kill_estimator(&pc->tcfc_bstats, + &pc->tcfc_rate_est); + kfree_rcu(pc, tcfc_rcu); + } return err; } |