Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp125001iof; Sun, 5 Jun 2022 23:06:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5oyBBBknn42/92BWBqKCLUGDq0FCHq5AM5zBZSToGrZuEKq38uCMZhn9115yq36Rg742M X-Received: by 2002:a17:90a:b703:b0:1dd:1e2f:97d7 with SMTP id l3-20020a17090ab70300b001dd1e2f97d7mr59517602pjr.62.1654495609034; Sun, 05 Jun 2022 23:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654495609; cv=none; d=google.com; s=arc-20160816; b=AgvsBcIZRSw4tGw2ZuDzG3CmA22P0rGkacsjVu8kIWgE3rsxeWginu2+4TXO8gO/6U LCNAWOd+vAemoZUf2B7kePeH2fzPY3IS21pwyeRFuKZ4JVXi5aRDrYgCJw8fkJRp/ZuI Dv3ifJMGSJNiNv8JqnIAFZZa4pE7Z1YOprbGF6CM6J4nB5CUVJoywnePkgayRUZmEIv/ 9OynKHhtoYDZxBGQdvOLENKsk56ScTWvjmlzhNz4OkSJIHxNdbVpRmfpitv1h4a+w5fj c1z2ZSYLpxf3hNYT+itgQDLMnC6/4CXU8a5E6aSNNwX9MlJEA4thgTWPDfR5NfF0gGhH I9mA== 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=m0dZZOzIYoAFfTHmdIYDVAtV9Am/o1XkrMiZYiz9Cfo=; b=ksm3fK0BTaIffW3bGfgWos4rPcykLHyIi/VSUyyliCN6CwnRO163lXY0hvtrLnj2xU Gyb67VYe6DpFkKrJS6kWkmNozYemwNrTj6PkStmwvGMBDuYC28E/2vupdUTKKk5FMaHq 82XWSFQjL1hIkmnt5L21ryLhRNPOc0OZWnzXGcSAGBX1p3IpRV6xwC8wOYxVc9KV+xxG DTw3UPrXMLq4+jHMNbRQNesNvmllBV2r1u4CU1d9FYaezywsZ9rrhz5EBnesW612QcFu LNrOyK41fuEkU9ucM4dJsfP2d7/uebu5C6bfBPsMoX+27yvUJVPSvPqGxjTLl/CItoIQ /GwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W5KIEmeS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f16-20020a056a00239000b0051c29a3639esi682742pfc.372.2022.06.05.23.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 23:06:49 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W5KIEmeS; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB890E3DE4; Sun, 5 Jun 2022 21:56:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347485AbiFCSUd (ORCPT + 99 others); Fri, 3 Jun 2022 14:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347361AbiFCSF4 (ORCPT ); Fri, 3 Jun 2022 14:05:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D1C85B89C; Fri, 3 Jun 2022 10:58:52 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1135061659; Fri, 3 Jun 2022 17:57:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04811C385A9; Fri, 3 Jun 2022 17:57:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654279067; bh=/5ETmfWm2uhKWwgWPbY3yLxXWCxaJ5ZGh8hkglP8XMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W5KIEmeSBJjsv1LO6uA8T4Bsbwenm4h0ZJhr1PL/nglQPPBaWHETdXKCoQd5Mshod RpdGEwwptaQQcrQA4wfQ6VqK8wNuyXWsewMKpiZjIpz7IvVFa/F61YmIeHEr9xSEjz BGMHRvdJQtP7mpmuYqFR72SUpkO1QSxZJ3ksFcf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Sutter , Pablo Neira Ayuso Subject: [PATCH 5.18 10/67] netfilter: nft_limit: Clone packet limits cost value Date: Fri, 3 Jun 2022 19:43:11 +0200 Message-Id: <20220603173821.029370451@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173820.731531504@linuxfoundation.org> References: <20220603173820.731531504@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phil Sutter commit 558254b0b602b8605d7246a10cfeb584b1fcabfc upstream. When cloning a packet-based limit expression, copy the cost value as well. Otherwise the new limit is not functional anymore. Fixes: 3b9e2ea6c11bf ("netfilter: nft_limit: move stateful fields out of expression data") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nft_limit.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/netfilter/nft_limit.c +++ b/net/netfilter/nft_limit.c @@ -213,6 +213,8 @@ static int nft_limit_pkts_clone(struct n struct nft_limit_priv_pkts *priv_dst = nft_expr_priv(dst); struct nft_limit_priv_pkts *priv_src = nft_expr_priv(src); + priv_dst->cost = priv_src->cost; + return nft_limit_clone(&priv_dst->limit, &priv_src->limit); }