Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp726219pxb; Tue, 2 Feb 2021 16:50:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRJ75lP4rX4uDmp7a/zd5kYiiiWU7CE2FZEwtsNrvE6vaeSLJlxdacZksQE4D3t91MG/qG X-Received: by 2002:a05:6402:35ca:: with SMTP id z10mr660934edc.186.1612313407773; Tue, 02 Feb 2021 16:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612313407; cv=none; d=google.com; s=arc-20160816; b=I0tuO6szp1IoxJtEY//clRYcZhEqviaHaVs/4uwIkXYJXvqzJSmTmUk8Y1ZGDb6/9p 8xzgI9N7v4UPSmhX9ZBOmaXTHpPDI0v3OTdvTnyNEEygfmKQnK3wn/vzh2UpXcOtQrdz f97HY0NwQcegdZtHc23ktgMN1cHfiaMJ4/bkUxyBcPwXpjYEC9u+ozU7fgnvpJG7xn85 SQkW9SfBKd2q7Y6hX5uYuAKaMNtoTUET2gXQvp1aWMdOlFTNdv7M+xiI7xG7PEV3VQwN J1myPhetQX/mROODdAUEyedNMEgg7OGzjistPw/G6R3SCuNBWH2YqpZE0NJIzusRac41 8Rhg== 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=3jWdz5PuuWP/ciYDxZi8zppfBVI2zaPaoUHKwXdZm7w=; b=S9/wAXrKKXU1tpu1Vr7ht3n4URqcH6A0QBftmHkCz/5LykkINp+ExnCShsc3avdi/N 69zQ7g27inZ1VEx8/HGDFspjr1V0e90fMEHu1ILqXTbzFQNaBaTusFpXMDCuw9uULrBH 5APQb8CwQbISKhlNnxojAKO0rm01j/KV3sCRi7U7jmq8HCKfkDFwkzmcJhF9EdAs0128 X3+5JbjP4oNkbBq5Azg8yTC195qXsa8wH+vzVzQMTQCp4qOIxMWI7x/x1013/k0571hm VISdOvWpqRBumc0ylsTTkVqBWwxP0Y6FvC28p3nx/CUvL+/EdC0bf/0y6spWFSM6BC/N +TgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nYjGBabM; 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 j5si299258ejv.429.2021.02.02.16.49.41; Tue, 02 Feb 2021 16:50:07 -0800 (PST) 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=nYjGBabM; 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 S233106AbhBBTy7 (ORCPT + 99 others); Tue, 2 Feb 2021 14:54:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:40788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233112AbhBBNvh (ORCPT ); Tue, 2 Feb 2021 08:51:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 56EDE64FB9; Tue, 2 Feb 2021 13:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612273399; bh=hptrUlrpb2xfuc9HI2i7QsEHfGGEY46N0AkeSC43JlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nYjGBabMct0PMyoeWb1p60nwTwFMlGXGEgRjxj4N3tqtjzs6JpNHqyyCsHTRg7TGQ 9CstOF058FHKV975nScoCs0fAxqlVxYVWCwU9SUr1Cqndgo8PsO6ICDhTpJT+AqH3N Xhr6wCBJfM7la0dS3M2LoFc6rRzv7ssXnWiuDt3Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso Subject: [PATCH 5.10 075/142] netfilter: nft_dynset: add timeout extension to template Date: Tue, 2 Feb 2021 14:37:18 +0100 Message-Id: <20210202133000.810852509@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210202132957.692094111@linuxfoundation.org> References: <20210202132957.692094111@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: Pablo Neira Ayuso commit 0c5b7a501e7400869ee905b4f7af3d6717802bcb upstream. Otherwise, the newly create element shows no timeout when listing the ruleset. If the set definition does not specify a default timeout, then the set element only shows the expiration time, but not the timeout. This is a problem when restoring a stateful ruleset listing since it skips the timeout policy entirely. Fixes: 22fe54d5fefc ("netfilter: nf_tables: add support for dynamic set updates") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nft_dynset.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/netfilter/nft_dynset.c +++ b/net/netfilter/nft_dynset.c @@ -204,8 +204,10 @@ static int nft_dynset_init(const struct nft_set_ext_add_length(&priv->tmpl, NFT_SET_EXT_EXPR, priv->expr->ops->size); if (set->flags & NFT_SET_TIMEOUT) { - if (timeout || set->timeout) + if (timeout || set->timeout) { + nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_TIMEOUT); nft_set_ext_add(&priv->tmpl, NFT_SET_EXT_EXPIRATION); + } } priv->timeout = timeout;