From patchwork Wed Feb 7 23:37:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 13549168 X-Patchwork-Delegate: kuba@kernel.org Received: from mail.netfilter.org (mail.netfilter.org [217.70.188.207]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DF94692F0; Wed, 7 Feb 2024 23:37:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.188.207 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707349060; cv=none; b=eOiGoXC43OegJQBnIwTUJsX0QOg7A9FvgiKInc029Z+mBW3zyKKHEIPCDt3Q9zuQB1i3rMUYQ/lJdmIkAwF3tIkzOmbdS61vNdyFgasy1HJwS1GN3GW2QfGQSZue+4JLqEGIN4YKpn9un6kDmgiD242G5nHgv7d7AFjW+hk0D7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707349060; c=relaxed/simple; bh=Iju1WJ9Ap8eJGChNGn1Xu+0Td4lpNM4WNCJCL29T/Ws=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Jo737/ZDXYyOSqcLNHraQbAegA3ZyY0dvpag8rWWgwrVT9aPvcPtYJn+efn0zeA3u/Kbte1fP45GWGJoCzqmR7JguLV41qb4wfg9NDd1ZEnvt6VFY8gxOuFWQ5Bw1gKWVs+9zvriwRud9j3v+d/Q7bGRanC20eO9Jmv41uehKe4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=netfilter.org; arc=none smtp.client-ip=217.70.188.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netfilter.org From: Pablo Neira Ayuso To: netfilter-devel@vger.kernel.org Cc: davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, fw@strlen.de Subject: [PATCH net 07/13] netfilter: nft_ct: reject direction for ct id Date: Thu, 8 Feb 2024 00:37:20 +0100 Message-Id: <20240207233726.331592-8-pablo@netfilter.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20240207233726.331592-1-pablo@netfilter.org> References: <20240207233726.331592-1-pablo@netfilter.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Direction attribute is ignored, reject it in case this ever needs to be supported Fixes: 3087c3f7c23b ("netfilter: nft_ct: Add ct id support") Signed-off-by: Pablo Neira Ayuso --- net/netfilter/nft_ct.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c index aac98a3c966e..bfd3e5a14dab 100644 --- a/net/netfilter/nft_ct.c +++ b/net/netfilter/nft_ct.c @@ -476,6 +476,9 @@ static int nft_ct_get_init(const struct nft_ctx *ctx, break; #endif case NFT_CT_ID: + if (tb[NFTA_CT_DIRECTION]) + return -EINVAL; + len = sizeof(u32); break; default: