Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3871425pxb; Tue, 17 Nov 2020 05:53:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/3NH/cYZa1jCe5QutCdV54qKNEzMecsRC5vUgB4O1++FFRCnszgNoSK0TMH6hpMcPvRfc X-Received: by 2002:a17:907:2d27:: with SMTP id gs39mr2864786ejc.387.1605621210373; Tue, 17 Nov 2020 05:53:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621210; cv=none; d=google.com; s=arc-20160816; b=unZDHZR1eDOu18bkekRAsK2g2M0ZRUYnSsCC9mQmPZ1a0ie0XuV24ur0AwsUfyPBTr wXv1LhHrOg4jcenEFWfgBv2Z68CDfDG1ngitpdqralT0hiyvQfG8bR/Wt+ALVfM6aj7I IM1l1n4mR9dOatblVoIP1/xLd+SMXCTxPYfyPTBLegzm4idpB557vXiduH6Z/1id8oKn ceuNOHAZ6TUl0BB595AZmlhRmGlSd+3XEoC8OsIomj5ERvwAwVkYnVjVPmFKpgWB05sk lRBntGKin16uPmmRJwPGQeoi1SJDoICjwomIH93HqMz6XFFdFCOnuCqYJj9mi6IbCbgL sc5Q== 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=ULktvEl+RrMw748ePKMOCxyAbFLJYwE+lxiwRxJS7PY=; b=mbJ6Yd9F+Xo3/fr6uTtUaq/SqEPDeFrc0hS0pDpAEOflt5Bu4lNa0mNAn9Z0RzWZd7 DpOBd0zMJeS2KlwP8TiDk97c27sewraz1Hyv8GWScZdIpSva31ND0FNWbYJo/JqZZ8UE C1wKRKUfrejEwg/b+t60c8uURgkNw+l6aL7Yz/pNEG6yZ5Oyxonodxu6O+FWCKz/7PUc yptS9VLs2RLIWSSGkio2gu85i1hUt5thdm6wTIZ+x8ULEhNwAmfgeo3o/K6K1Vt+rOw2 63XvjmwAXzUaVTGKRu8FQsjh4zRaPOeJtTW/hnw3woYBSevIQ16ViknGBFE0l370exQf 9lqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L0L3hPBT; 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=fail (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 lm18si700945ejb.537.2020.11.17.05.53.07; Tue, 17 Nov 2020 05:53:30 -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=@kernel.org header.s=default header.b=L0L3hPBT; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733176AbgKQNuS (ORCPT + 99 others); Tue, 17 Nov 2020 08:50:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:42568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731935AbgKQNcq (ORCPT ); Tue, 17 Nov 2020 08:32:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 52D402168B; Tue, 17 Nov 2020 13:32:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619964; bh=I5VsDkfZ/Kg5Wu2VzDmH8nOlDCtHDNa0Of/J8wIebE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L0L3hPBTBj0C/h2uV+vl98BpnW46R54sRF2x1RleAiHn2cAuOHaWHRlZEH8xOQYdM Nc8wM5nOk0Pf9oUD5UsUOFBPuBj9iZHZlu2DdNsBOZmY0mVBu5+GfjHOh7CQBwuV0+ CpAR5/a38j2Xze8EwdmyH9zzvs6ciBnabRG1Eld4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.9 023/255] netfilter: nftables: fix netlink report logic in flowtable and genid Date: Tue, 17 Nov 2020 14:02:43 +0100 Message-Id: <20201117122140.072117870@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@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 [ Upstream commit dceababac29d1c53cbc1f7ddf6f688d2df01da87 ] The netlink report should be sent regardless the available listeners. Fixes: 84d7fce69388 ("netfilter: nf_tables: export rule-set generation ID") Fixes: 3b49e2e94e6e ("netfilter: nf_tables: add flow table netlink frontend") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 72f3ee47e478f..1c90bd1fce60c 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -7076,7 +7076,7 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, GFP_KERNEL); kfree(buf); - if (ctx->report && + if (!ctx->report && !nfnetlink_has_listeners(ctx->net, NFNLGRP_NFTABLES)) return; @@ -7198,7 +7198,7 @@ static void nf_tables_gen_notify(struct net *net, struct sk_buff *skb, audit_log_nfcfg("?:0;?:0", 0, net->nft.base_seq, AUDIT_NFT_OP_GEN_REGISTER, GFP_KERNEL); - if (nlmsg_report(nlh) && + if (!nlmsg_report(nlh) && !nfnetlink_has_listeners(net, NFNLGRP_NFTABLES)) return; -- 2.27.0