From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753381AbbIBA7b (ORCPT ); Tue, 1 Sep 2015 20:59:31 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:52817 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753200AbbIBA6y (ORCPT ); Tue, 1 Sep 2015 20:58:54 -0400 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Jamal Hadi Salim , Daniel Borkmann , Cong Wang , Cong Wang , "David S. Miller" , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release() Date: Tue, 1 Sep 2015 17:58:00 -0700 Message-Id: <1441155486-26089-55-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441155486-26089-1-git-send-email-kamal@canonical.com> References: <1441155486-26089-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.13.11-ckt26 -stable review patch. If anyone has any objections, please let me know. ------------------ From: WANG Cong 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 Cc: Daniel Borkmann Signed-off-by: Cong Wang Signed-off-by: Cong Wang Acked-by: Daniel Borkmann Signed-off-by: David S. Miller [ kamal: backport to 3.13-stable: context ] Signed-off-by: Kamal Mostafa --- 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