Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3299870ybb; Tue, 31 Mar 2020 02:24:25 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuNPcQwPrySEGboJMuMNEeq9ZVRpt7vng8J76s/PHyuVutKidP+jhssYH8jdxV342YZsL2+ X-Received: by 2002:a54:4197:: with SMTP id 23mr1459108oiy.87.1585646664879; Tue, 31 Mar 2020 02:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646664; cv=none; d=google.com; s=arc-20160816; b=Do6luOCKmyuHwsblOP6Z1sqfmRNHBs5SnV1n9Ti5JErMAKvsnX9swwyeAOJI2oJu8C HOAnnSKGedzJNUvH9/pqqmcSuUqYaR0QcbHhsz6crPrW8YC7KcJH7cp1vum09rd/QIBh 2iX2+Njs1Cp6s+j3VpEgQGNw9/LxfSDzR8c1ae+3R0SIgVvfjWXTRM520AxaCpP1m4pY IwY3pkRzx/hHV+oWq5uYkC0ZQB2glwfo+Xd+RPf/BpwP1tRswTQ/BSniOv+h1sBTJ1tH 2xZtjxOdsBEsisj0+6hVSn60zWLotQuOScjTNds01Ct/w1MUcVrJ4Eono69NtApsYYUy yLCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bbjz2bd2vnJux6zRkL3IBZrvnKOaDGbTMP9oVt5bCvM=; b=GhNNMqJ+Bpjrogl+XKaTwjAWsRmK0mob9MYtxANiA6Jsy/XHxlqm215ou7i3DU3s8R +vrmQXVYuC82hARCAd6jq/7fb+NmrSKuI4ACoiepxq9if+L4GY57iLR+dWJQ5Ky3UYpd gtcbIQtySw37qZt/3LyiTvyBIQQtamCSBza/cZLnfLmrYBCG7xnQB00YJgNxVafjBpKV ftmeo8lXUyjI88HKITplL7iiLrUd9OnJLiiN4AMpq8aycUtbPLStyNJ87EegpQzrMUVg nvXr2viznqzOxEbr+fKyMVRHJ/xZlsEKOis1r9xnfXvrCOOh8pNqCh37p9ZCc0diE/fO uu8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W17CFuEI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si6394904ooo.92.2020.03.31.02.24.12; Tue, 31 Mar 2020 02:24:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=W17CFuEI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730238AbgCaJDe (ORCPT + 99 others); Tue, 31 Mar 2020 05:03:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730834AbgCaJDc (ORCPT ); Tue, 31 Mar 2020 05:03:32 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C7D820787; Tue, 31 Mar 2020 09:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645412; bh=JspOp3JCato+Ngd4oQfQrfM4XN3jMP+GM9OQRSWLRW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W17CFuEIa0l2m2Zo0EYYtQL03G54w6MM2IIrBD9z4bthJC6gvx8n9DKqSBE/6C/Rk j0u3+Jrh21V3PnVt3dd+TtpIFWZ6Loi80IQcHZ60CQeMPNU/4Tv4BvcaYB7ZN7kHn0 W/fb+2A+QASaktY1b+0lPdxP5b6gyH0deYVzmg9I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Blakey , "David S. Miller" Subject: [PATCH 5.5 028/170] net/sched: act_ct: Fix leak of ct zone template on replace Date: Tue, 31 Mar 2020 10:57:22 +0200 Message-Id: <20200331085427.087743003@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Blakey [ Upstream commit dd2af10402684cb5840a127caec9e7cdcff6d167 ] Currently, on replace, the previous action instance params is swapped with a newly allocated params. The old params is only freed (via kfree_rcu), without releasing the allocated ct zone template related to it. Call tcf_ct_params_free (via call_rcu) for the old params, so it will release it. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: Paul Blakey Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/sched/act_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -739,7 +739,7 @@ static int tcf_ct_init(struct net *net, if (goto_ch) tcf_chain_put_by_act(goto_ch); if (params) - kfree_rcu(params, rcu); + call_rcu(¶ms->rcu, tcf_ct_params_free); if (res == ACT_P_CREATED) tcf_idr_insert(tn, *a);