Article View: linux.kernel.netdev
Article #5569Re: [PATCH net 08/10] netfilter: xt_dccp: handle reserved options as single-byte
From: netdev-bot+sashiko
Date: Tue, 20 Oct 2026 15:38
Date: Tue, 20 Oct 2026 15:38
122 lines
10799 bytes
10799 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0 (1)
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] The commit message lists CONFIG_NETFILTER_XTABLES_LEGACY as a
prerequisite for the bug.
Pre-existing issues:
- [Low] This problem wasn't introduced by this patch, but
dccp_find_option() in net/netfilter/xt_dccp.c does not validate multi-…
--
netfilter: xt_dccp: handle reserved options as single-byte
This commit changes dccp_find_option() so that every DCCP option number
up to DCCPO_MAX_RESERVED is treated as a single-byte option. Before, only
Padding and Mandatory were. The old behaviour read the byte after a
reserved option as a TLV length, which could skip a later option and
invert an XT_DCCP_OPTION rule result.
> Treat every option up to DCCPO_MAX_RESERVED as single-byte, matching the
> protocol definition. Triggering requires
> CONFIG_NETFILTER_XTABLES_LEGACY, CONFIG_NETFILTER_XT_MATCH_DCCP, an
> option-based rule, and remote protocol-33 reachability.
[Severity: Medium]
Is CONFIG_NETFILTER_XTABLES_LEGACY actually needed to trigger this?
In net/netfilter/Kconfig, NETFILTER_XT_MATCH_DCCP sits inside the
if NETFILTER_XTABLES block and depends only on NETFILTER_ADVANCED:
config NETFILTER_XT_MATCH_DCCP
tristate '"dccp" protocol match support (DEPRECATED)'
depends on NETFILTER_ADVANCED
NFT_COMPAT depends only on NETFILTER_XTABLES:
config NFT_COMPAT
depends on NETFILTER_XTABLES
nft_match_select_ops() in net/netfilter/nft_compat.c looks up the
registered "dccp" match by name:
match = xt_request_find_match(family, mt_name, rev);
The nft_compat packet path then reaches the same parser:
__nft_match_eval()
match->match(skb, &xt)
dccp_mt()
match_option()
dccp_find_option()
So iptables-nft setups without legacy tables support seem to have the
same reserved-option bypass. The fix in the shared helper covers both
frontends. Only the stated trigger conditions look wrong.
Could the commit message drop CONFIG_NETFILTER_XTABLES_LEGACY from the
prerequisites, or list CONFIG_NFT_COMPAT as an alternative? That way
backport and security triage won't skip nft-based systems.
> diff --git a/net/netfilter/xt_dccp.c b/net/netfilter/xt_dccp.c
> index 3db81e041af9..23a4e3e8df7d 100644
> --- a/net/netfilter/xt_dccp.c
> +++ b/net/netfilter/xt_dccp.c
> @@ -62,7 +62,7 @@ dccp_find_option(u_int8_t option,
> return true;
> }
>
> - if (op[i] < 2 || i == optlen - 1)
> + if (op[i] <= DCCPO_MAX_RESERVED || i == optlen - 1)
> i++;
> else
> i += op[i + 1] ? : 1;
[Severity: Low]
This isn't a bug introduced by this patch, but should dccp_find_option()
also reject multi-byte option lengths below 2?
For a type of 32 or above, a length byte of 0 or 1 moves i forward by one
byte. The next loop iteration then reads the length byte as an option
type.
For example, with options {32, 1, 0, 0} and --dccp-option 1:
i = 0: op[0] == 32, no match, i += op[1] (1)
i = 1: op[1] == 1, matches, returns true
No Mandatory option is actually present here. A {32, 0, ...} sequence
gives a phantom match for option 0 the same way.
nft_exthdr_dccp_eval() in net/netfilter/nft_exthdr.c parses the same
option space. It stops with no match on such lengths:
if (buflen < 2)
goto err;
len = bufp[1];
if (len < 2)
goto err;
So xt_dccp and nft exthdr dccp still give different answers for the same
malformed packet. Since the length byte is below 2, the phantom match
can only be option type 0 or 1. This patch brings the single-byte
classification in line with nft_exthdr but leaves this length check
difference in place.
Would it make sense to stop parsing (or treat it as no match) when
op[i + 1] < 2, as nft_exthdr_dccp_eval() does?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261019150249.1879516-2-pablo%40netfilter.org
Technical Details
Message-ID:
<179251068646.3135.16276902372052104830@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349372-linux-kernel-netdev=dewy.ruReferences:
<20261019150249.1879516-9-pablo@netfilter.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-349372-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 08/10] netfilter: xt_dccp: handle reserved options as single-byte Date: Tue, 20 Oct 2026 15:38:06 +0000 Organization: Usenet Network Message-ID: <179251068646.3135.16276902372052104830@kernel.org> References: <20261019150249.1879516-9-pablo@netfilter.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3887464"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Xb8w69CEOZ75s1GNbndI3zbiB0E= sha256:2wFeIZdm6X1USO0XfB+POt0B13W46OYaNI+X03V28bg= sha1:axZc1ZyGdSFktUEK/zBQ5CBnbOE= sha256:dlyd393Y80WG60b36RiQsYcnEoUpZ3hnpWrFVWS3v6M= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 58F56110D61; Tue, 20 Oct 2026 18:47:06 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.2 X-Spam-Status: No, score=-3.2 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GLR77JuWt-K7; Tue, 20 Oct 2026 18:47:03 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-349372-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id F0D72110D60; Tue, 20 Oct 2026 18:46:59 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3FB4961A4B; Tue, 20 Oct 2026 15:39:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792510718; b=2N0Y5kLtP/9WGVUiZCUYoyNQ02tVKZlPL5lQ63NE7hASvON+jY3fUbu1c3Nq/nCXyyrU Twh+f8N2EpU+FTBFJNFbvVWrhYcixd/Z4CsriAYu9IeLQin2fHooHoRYNdUPHuryl0hvv ZJQyJChRldguBMWO7YUgta03LXKM3UmdJT8NPvPwQWjMvU1Aqs4vEE6Xp2EIO6nSTA9oe sw8sZ9xgJjQCxruqwUoJanP8abxqA0Hs3BNppRqt9dmixaGS+6ZV0dRZbnB29O8bzM2em b0obPj9RLbDyo0Qj8ARl20C4Vqpf5EROkqW62DeYGl+lgZEbGtGzFVp+67xZ4cxmvOQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792510718; h=X-Original-To:Received:Received:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version; bh=xMhauGuOviU6sajrjNwmfyby/CGvunKqOWW0fHPH6e4=; b=QCmqdt2Z8xhK3vjsIZ1CxHYsjQ3f9Xr/YDvotWUiPi4Fb9KdccdsQKTjdapLB9oUhl9a EHMFtlepLZIbJXBcD09ojhtcXkgquIRcouTvX8+9qq6vPNnwzFLjiYBHAzkKxMdyruD3T EGIh8+zeg5g1vO1spsBHQYw6SJ7/O0UFzSm9sGwZYxip3AonqFSD56DX6GY90gU6y6Dpq vHYWy29yaVe4NtGSTPPq0S9BEJKEc886JCpfvsGCAcYv5BEyLrR2kGQpSd++QgheowYz0 RuuP6I7Hju7nMrlK5kFfPu1jju5lUo1ePGj2X0CgyN4uuczmjrFmZezI+zgzvqOF9qw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86277606A33F; Tue, 20 Oct 2026 15:38:38 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792510717; b=oC47fnV5F1ST3emaOr++Sn1Qr2+THMgO87MX+H+ioMy/u3tENI9WadVt+WeK4v4z/9TZ tufKRO4227LiE+h2Ihg4bZ9iyZcBKuNwBEvyzfQYauQwH1AvVf5WApohwQHOA+wvPzOiV 2pu+cpio4fhy9cA/QWO2/R79CmleIB/GWQ+7qP5AYssoxN+uR6Wo9fYCjJbMJ0DbckWu2 dAaPhArCGKO5xE6ePv4ocqXugyhqVl62DhM6uEFVkFpy/OauIqiC5i11mbn6PQCYcUQqC z8blUCcoyd0n16ryTC/Q4XUQFr58iNtV0WhvEZySD5O1XCriw2egqFDtx+p/VqPhLHg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792510717; h=Received:Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: X-sashiko-severity:Content-Type:Content-Transfer-Encoding: MIME-Version; bh=xMhauGuOviU6sajrjNwmfyby/CGvunKqOWW0fHPH6e4=; b=esYBBvYUzBgbDYShBjwlVJnvAYFgc0bjJ6YcLikfaRe1QlIEDNy0RApWGI2XFrtt6WZB SGhW7TzoLBd+V2bdLy8959gRFSnzdL/VV0BzWlKYFc4qFmYl7tEuy7hdUOT1v3AYwyOoi gK7XSvH7wPmPhlERYKmfY7vVPb+h9j9cELYdVMSP3XuvcaLS104ldkvaahAe3EgRUgMfi wu/FzT2qg26gnwk3fk2PYofYbhD1OqPm8SBYBGFEsPy7rD9XkQoVq+vo6pwR/hYhhD3RZ P5D9uoCLhs9zwB1AQq9t4m1si0pNZNu1j3difR7hCr8GOJjm/u5tHIFzEszR2aZFUbw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A54CC606A323; Tue, 20 Oct 2026 15:38:37 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8E741F000C4; Tue, 20 Oct 2026 15:38:36 +0000 (UTC) X-Cc: netfilter-devel@vger.kernel.org, davem@davemloft.net, netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com, edumazet@kernel.org, horms@kernel.org, fw@strlen.de, ja@ssi.bg X-In-Reply-To: <20261019150249.1879516-9-pablo@netfilter.org> X-sashiko-severity: Medium X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list