Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4355696pxj; Tue, 8 Jun 2021 12:16:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyW69AY9hwFPLT1tQfQMKAKlkeCX+Ajso16vFmUTncFsdcpHiYbUpK2CCJ6Jkf0AY3qxamc X-Received: by 2002:a17:906:1952:: with SMTP id b18mr24305324eje.262.1623179779396; Tue, 08 Jun 2021 12:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623179779; cv=none; d=google.com; s=arc-20160816; b=TYAesSLWJxA699JR2ZZJoExwBZOm0dssBtHlTvf0/T0kKZq2wtIpFjw26/W5UfIadT SviSysefFc84w+fxN3j4xCQQ8M19Yb/V2RvpobRdEOVOzCFVh0FDraxakEismngygzf6 ejJePXtEf4hOuokLPCbfgn37K+jYVtOh6cITO8BETPlSYqlRZVQ2Bu07QYgV9wnp9Ojo 2uwpP8o3uQYFgZrJOkW0U7c7uZNrb/T5p4JnJRVwu66O9D5aY6F0vyTF7DS/+SyqaVin Pxuo1RTMxR8RzTSgkIME8uQI4fn9feDfB4lBzzXBEaXpeJu3fdK/UP9b1bPBD746n9Fe kfbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d4w1YA9YmdpmoGK90h8ogDowv9q+8nYZtLkRKf+Gx+A=; b=dkh2gN/3H/D873SW40HQU3U+hnCY45FA1Sm/5CDI+GrDrgxNeJoTya4dJY9CmtrUje k7hHr/iTi3Hwzsqc4vB34v6YICGwuKD3PvzQz9olcGxdN3gTltoSYmNe1zUPUzxPCFKg NJklkqVIZOuwLSS5Rw+6OM72AWylJAgpEtVQWO3sQ5Iwqr+m7XQa5ZJwQF2fqn/2ojXV 5+hhFGxLs9z9aaBUr6/E8kychqJYBtHha1+BbDXJiGAE+IqJEssd97R9CluJq168yUst WO/xs584I3n0uCHCuCrU9Z3jFFSVEW9kb2JFNy2+mQ7tjSjsLAnSLqprGr+Cev+8bJN8 n0vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uZ1GipsT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si460291ejl.150.2021.06.08.12.15.56; Tue, 08 Jun 2021 12:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uZ1GipsT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238425AbhFHTO5 (ORCPT + 99 others); Tue, 8 Jun 2021 15:14:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:41040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237072AbhFHTD7 (ORCPT ); Tue, 8 Jun 2021 15:03:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2959E6191E; Tue, 8 Jun 2021 18:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177953; bh=u4T7+fTLSggaCS+GIrJfbGxBZ7qMiRZQooTiebhGGDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uZ1GipsTdX6RfLDANjvjk9kjYG6lvYNU2M7vAiLV7DulQJbVhxNBXE1tvHeoiXM7u vYezd9IPxXPoCrBZ4vHRUjEu3ciM6tHso1EZMx7N1b2kqS7CpZxGeLwX/BPoSb9dGD XjXspzqZzlATeRzQhLsKZjnToyMz7YsNlOO2Xe6M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ariel Levkovich , Marcelo Ricardo Leitner , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.12 023/161] net/sched: act_ct: Fix ct template allocation for zone 0 Date: Tue, 8 Jun 2021 20:25:53 +0200 Message-Id: <20210608175946.235253991@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175945.476074951@linuxfoundation.org> References: <20210608175945.476074951@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ariel Levkovich [ Upstream commit fb91702b743dec78d6507c53a2dec8a8883f509d ] Fix current behavior of skipping template allocation in case the ct action is in zone 0. Skipping the allocation may cause the datapath ct code to ignore the entire ct action with all its attributes (commit, nat) in case the ct action in zone 0 was preceded by a ct clear action. The ct clear action sets the ct_state to untracked and resets the skb->_nfct pointer. Under these conditions and without an allocated ct template, the skb->_nfct pointer will remain NULL which will cause the tc ct action handler to exit without handling commit and nat actions, if such exist. For example, the following rule in OVS dp: recirc_id(0x2),ct_state(+new-est-rel-rpl+trk),ct_label(0/0x1), \ in_port(eth0),actions:ct_clear,ct(commit,nat(src=10.11.0.12)), \ recirc(0x37a) Will result in act_ct skipping the commit and nat actions in zone 0. The change removes the skipping of template allocation for zone 0 and treats it the same as any other zone. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: Ariel Levkovich Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/20210526170110.54864-1-lariel@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- net/sched/act_ct.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c index 371fd64638d2..ba7f57cb41c3 100644 --- a/net/sched/act_ct.c +++ b/net/sched/act_ct.c @@ -1205,9 +1205,6 @@ static int tcf_ct_fill_params(struct net *net, sizeof(p->zone)); } - if (p->zone == NF_CT_DEFAULT_ZONE_ID) - return 0; - nf_ct_zone_init(&zone, p->zone, NF_CT_DEFAULT_ZONE_DIR, 0); tmpl = nf_ct_tmpl_alloc(net, &zone, GFP_KERNEL); if (!tmpl) { -- 2.30.2