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 16:01:29 +0200	[thread overview]
Message-ID: <efbf5943-f136-4330-b896-d6b7a2d02796@kernel.org> (raw)
In-Reply-To: <83f8ef32-9060-4fde-b947-926ec1d830c8@0upti.me>

Hi Ilya,

(+ add people/ML back in cc)

On 23/10/2024 14:11, Ilya K wrote:
>> 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
> 
> The patch never got merged, but Pablo's very similar patch did. Are you
> by any chance applying my changes on top of a tree that also contains
> his?

Thank you for this reply!

Oh, sorry, I see the issue now, just an unlucky situation:

- On one hand, and probably because the issue was visible on stable too,
Pablo sent a new version changing the author and the title ("not to
load" vs "to not load") [1]. Because of that, the bot didn't mark the
previous version as superseded.

- On the other hand, the CI tried to apply all the pending patches,
including this patch here: when git tried to apply this patch, it
managed to find the exact same context a bit before, and then modified
the wrong line [2].

The two combined resulted in the CI trying to validate a buggy patch not
doing what it was intended to do.

From what I understood, Paolo is changing the status of [1] and even [3]
on Patchwork, and soon the CI will stop using the wrong patch.

[1]
https://patchwork.kernel.org/project/netdevbpf/patch/20241021094536.81487-3-pablo@netfilter.org/
[2]
https://github.com/linux-netdev/testing/commit/096e5d7e7d38271b6353ecd197e8ec00a01dbfd3
[3]
https://patchwork.kernel.org/project/netdevbpf/patch/20241018162517.39154-1-ignat@cloudflare.com/

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


      parent reply	other threads:[~2024-10-23 14:01 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
     [not found]   ` <83f8ef32-9060-4fde-b947-926ec1d830c8@0upti.me>
2024-10-23 14:01     ` Matthieu Baerts [this message]

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=efbf5943-f136-4330-b896-d6b7a2d02796@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®