From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17E27C83F17 for ; Mon, 28 Aug 2023 10:16:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjH1KP5 (ORCPT ); Mon, 28 Aug 2023 06:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbjH1KPq (ORCPT ); Mon, 28 Aug 2023 06:15:46 -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 D0B3495 for ; Mon, 28 Aug 2023 03:15:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 65C5A6158B for ; Mon, 28 Aug 2023 10:15:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72998C433C8; Mon, 28 Aug 2023 10:15:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1693217742; bh=wYuCaAWBmnylkTJISophBRYAd89Tr5Z+ldQZqFykO6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mvWh73P4Q/ckYKzQEqvnNkZQvXWaNaVnxNJEFFS2tMnzq6ZfnhqI96E4DK6v+BTPJ 7+2I9p88L1+wm0hmWJGOv6IHZmWf/hJ6PYA6w7AGT48pHvbaH3Q0VR+w8tFSgEYm5g 1lyh+lwoiftcaPxXkyxlix6PzJM3ie7LEuYgihKA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pablo Neira Ayuso , Florian Westphal , Sasha Levin Subject: [PATCH 4.14 24/57] netfilter: nft_dynset: disallow object maps Date: Mon, 28 Aug 2023 12:12:44 +0200 Message-ID: <20230828101145.129175065@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230828101144.231099710@linuxfoundation.org> References: <20230828101144.231099710@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pablo Neira Ayuso [ Upstream commit 23185c6aed1ffb8fc44087880ba2767aba493779 ] Do not allow to insert elements from datapath to objects maps. Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements") Signed-off-by: Pablo Neira Ayuso Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin --- net/netfilter/nft_dynset.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c index d1dc5c8937a56..461bdecbe7fc2 100644 --- a/net/netfilter/nft_dynset.c +++ b/net/netfilter/nft_dynset.c @@ -137,6 +137,9 @@ static int nft_dynset_init(const struct nft_ctx *ctx, if (IS_ERR(set)) return PTR_ERR(set); + if (set->flags & NFT_SET_OBJECT) + return -EOPNOTSUPP; + if (set->ops->update == NULL) return -EOPNOTSUPP; -- 2.40.1