[3.13.y-ckt stable] Patch "act_pedit: check binding before calling tcf_hash_release()" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Wed Sep 2 00:55:54 UTC 2015


This is a note to let you know that I have just added a patch titled

    act_pedit: check binding before calling tcf_hash_release()

to the linux-3.13.y-queue branch of the 3.13.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.13.y-queue

This patch is scheduled to be released in version 3.13.11-ckt26.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.13.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 1228113b454462624015ffc75049802788f1cfdb Mon Sep 17 00:00:00 2001
From: WANG Cong <xiyou.wangcong at gmail.com>
Date: Thu, 30 Jul 2015 17:12:21 -0700
Subject: act_pedit: check binding before calling tcf_hash_release()

commit 5175f7106cc55a1bcf97bf7d5ba0900017ebcef8 upstream.

When we share an action within a filter, the bind refcnt
should increase, therefore we should not call tcf_hash_release().

Fixes: 1a29321ed045 ("net_sched: act: Dont increment refcnt on replace")
Cc: Jamal Hadi Salim <jhs at mojatatu.com>
Cc: Daniel Borkmann <daniel at iogearbox.net>
Signed-off-by: Cong Wang <xiyou.wangcong at gmail.com>
Signed-off-by: Cong Wang <cwang at twopensource.com>
Acked-by: Daniel Borkmann <daniel at iogearbox.net>
Signed-off-by: David S. Miller <davem at davemloft.net>
[ kamal: backport to 3.13-stable: context ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 net/sched/act_pedit.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 7aa2dcd..99682a9 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -83,13 +83,12 @@ static int tcf_pedit_init(struct net *net, struct nlattr *nla,
 		}
 		ret = ACT_P_CREATED;
 	} else {
-		p = to_pedit(pc);
-		tcf_hash_release(pc, bind, &pedit_hash_info);
 		if (bind)
 			return 0;
+		tcf_hash_release(pc, bind, &pedit_hash_info);
 		if (!ovr)
 			return -EEXIST;
-
+		p = to_pedit(pc);
 		if (p->tcfp_nkeys && p->tcfp_nkeys != parm->nkeys) {
 			keys = kmalloc(ksize, GFP_KERNEL);
 			if (keys == NULL)
--
1.9.1





More information about the kernel-team mailing list