summary refs log tree commit diff
path: root/net/sched/act_pedit.c
diff options
context:
space:
mode:
authorHiroaki SHIMODA <shimoda.hiroaki@gmail.com>2012-08-06 05:45:48 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-06 13:30:01 -0700
commit47fd92f5a76eb3f5b407773766e7d7fa1a179419 (patch)
treefbebbe0628917989117a97ddf5737ceda816bccf /net/sched/act_pedit.c
parent9871f1ad677d95ffeca80e2c21b70af9bfc9cc91 (diff)
downloadlinux-47fd92f5a76eb3f5b407773766e7d7fa1a179419.tar.gz
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_pedit.c')
-rw-r--r--net/sched/act_pedit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 26aa2f6ce257..45c53ab067a6 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -74,7 +74,10 @@ static int tcf_pedit_init(struct nlattr *nla, struct nlattr *est,
 		p = to_pedit(pc);
 		keys = kmalloc(ksize, GFP_KERNEL);
 		if (keys == NULL) {
-			kfree(pc);
+			if (est)
+				gen_kill_estimator(&pc->tcfc_bstats,
+						   &pc->tcfc_rate_est);
+			kfree_rcu(pc, tcfc_rcu);
 			return -ENOMEM;
 		}
 		ret = ACT_P_CREATED;