mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Ilya Katsnelson <me@0upti.me>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Florian Westphal <fw@strlen.de>, Sasha Levin <sashal@kernel.org>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6
Date: Wed, 23 Oct 2024 11:56:18 +0200	[thread overview]
Message-ID: <fde8d1b6-9812-418c-8ba4-ae2384251ee7@kernel.org> (raw)
In-Reply-To: <20241018-xtables-typos-v1-1-02a51789c0ec@0upti.me>

Hi Ilya,

On 18/10/2024 17:45, Ilya Katsnelson wrote:
> These were added with the wrong family in 4cdc55e, which seems
> to just have been a typo, but now ip6tables rules with --set-mark
> don't work anymore, which is pretty bad.

Funny, with this patch, now the v4 version doesn't work any more, which
is pretty bad as well ;-)

More seriously, it looks like your patch broke MPTCP selftests:


https://netdev-3.bots.linux.dev/vmksft-mptcp-dbg/results/826643/1-mptcp-join-sh/stdout

Two tests are now failing, because they can no longer add a mark:

> # iptables -t mangle -A OUTPUT -j MARK --set-mark 1
> Warning: Extension MARK revision 0 not supported, missing kernel module?
> iptables v1.8.10 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain OUTPUT

Please see below:

> diff --git a/net/netfilter/xt_NFLOG.c b/net/netfilter/xt_NFLOG.c
> index d80abd6ccaf8f71fa70605fef7edada827a19ceb..6dcf4bc7e30b2ae364a1cd9ac8df954a90905c52 100644
> --- a/net/netfilter/xt_NFLOG.c
> +++ b/net/netfilter/xt_NFLOG.c
> @@ -79,7 +79,7 @@ static struct xt_target nflog_tg_reg[] __read_mostly = {
>  	{
>  		.name       = "NFLOG",
>  		.revision   = 0,
> -		.family     = NFPROTO_IPV4,
> +		.family     = NFPROTO_IPV6,

Here, by setting the family to v6 instead of v4, we now have two targets
that are exactly the same, both for v6:

>   67   │ static struct xt_target nflog_tg_reg[] __read_mostly = {
>   68   │     {
>   69   │         .name       = "NFLOG",
>   70   │         .revision   = 0,
>   71   │         .family     = NFPROTO_IPV6,  /* <== The line you modified */
>   72   │         .checkentry = nflog_tg_check,
>   73   │         .destroy    = nflog_tg_destroy,
>   74   │         .target     = nflog_tg,
>   75   │         .targetsize = sizeof(struct xt_nflog_info),
>   76   │         .me         = THIS_MODULE,
>   77   │     },
>   78   │ #if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
>   79   │     {
>   80   │         .name       = "NFLOG",
>   81   │         .revision   = 0,
>   82   │         .family     = NFPROTO_IPV6,  /* <== v6 was already there */
>   83   │         .checkentry = nflog_tg_check,
>   84   │         .destroy    = nflog_tg_destroy,
>   85   │         .target     = nflog_tg,
>   86   │         .targetsize = sizeof(struct xt_nflog_info),
>   87   │         .me         = THIS_MODULE,
>   88   │     },
>   89   │ #endif
>   90   │ };

Are you sure you didn't have the bug you mentioned because your kernel
config doesn't have CONFIG_IP6_NF_IPTABLES?

>  		.checkentry = nflog_tg_check,
>  		.destroy    = nflog_tg_destroy,
>  		.target     = nflog_tg,
> diff --git a/net/netfilter/xt_mark.c b/net/netfilter/xt_mark.c
> index f76fe04fc9a4e19f18ac323349ba6f22a00eafd7..65b965ca40ea7ea5d9feff381b433bf267a424c4 100644
> --- a/net/netfilter/xt_mark.c
> +++ b/net/netfilter/xt_mark.c
> @@ -62,7 +62,7 @@ static struct xt_target mark_tg_reg[] __read_mostly = {
>  	{
>  		.name           = "MARK",
>  		.revision       = 2,
> -		.family         = NFPROTO_IPV4,
> +		.family         = NFPROTO_IPV6,

Same here.

So I think this patch is not needed, right?

>  		.target         = mark_tg,
>  		.targetsize     = sizeof(struct xt_mark_tginfo2),
>  		.me             = THIS_MODULE,
> 
> ---
> base-commit: 75aa74d52f43e75d0beb20572f98529071b700e5
> change-id: 20241018-xtables-typos-dfeadb8b122d
> 
> Best regards,

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  parent reply	other threads:[~2024-10-23  9:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18 15:45 Ilya Katsnelson
2024-10-18 16:14 ` Phil Sutter
2024-10-23  9:56 ` Matthieu Baerts [this message]
     [not found]   ` <83f8ef32-9060-4fde-b947-926ec1d830c8@0upti.me>
2024-10-23 14:01     ` Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fde8d1b6-9812-418c-8ba4-ae2384251ee7@kernel.org \
    --to=matttbe@kernel.org \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@0upti.me \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=sashal@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®