* [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6
@ 2024-10-18 15:45 Ilya Katsnelson
2024-10-18 16:14 ` Phil Sutter
2024-10-23 9:56 ` Matthieu Baerts
0 siblings, 2 replies; 4+ messages in thread
From: Ilya Katsnelson @ 2024-10-18 15:45 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Westphal,
Sasha Levin
Cc: netfilter-devel, coreteam, netdev, linux-kernel, Ilya Katsnelson
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.
Fixes: 4cdc55ec6222 ("netfilter: xtables: avoid NFPROTO_UNSPEC where needed")
Signed-off-by: Ilya Katsnelson <me@0upti.me>
---
net/netfilter/xt_NFLOG.c | 2 +-
net/netfilter/xt_mark.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
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,
.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,
.target = mark_tg,
.targetsize = sizeof(struct xt_mark_tginfo2),
.me = THIS_MODULE,
---
base-commit: 75aa74d52f43e75d0beb20572f98529071b700e5
change-id: 20241018-xtables-typos-dfeadb8b122d
Best regards,
--
Ilya Katsnelson <me@0upti.me>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 2024-10-18 15:45 [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 Ilya Katsnelson @ 2024-10-18 16:14 ` Phil Sutter 2024-10-23 9:56 ` Matthieu Baerts 1 sibling, 0 replies; 4+ messages in thread From: Phil Sutter @ 2024-10-18 16:14 UTC (permalink / raw) To: Ilya Katsnelson Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Westphal, Sasha Levin, netfilter-devel, coreteam, netdev, linux-kernel On Fri, Oct 18, 2024 at 06:45:00PM +0300, 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. > > Fixes: 4cdc55ec6222 ("netfilter: xtables: avoid NFPROTO_UNSPEC where needed") On my system, the commit is 0bfcb7b71e735560077a42847f69597ec7dcc326. Is that correct? > Signed-off-by: Ilya Katsnelson <me@0upti.me> Reviewed-by: Phil Sutter <phil@nwl.cc> ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 2024-10-18 15:45 [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 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> 1 sibling, 1 reply; 4+ messages in thread From: Matthieu Baerts @ 2024-10-23 9:56 UTC (permalink / raw) To: Ilya Katsnelson, Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Westphal, Sasha Levin Cc: netfilter-devel, coreteam, netdev, linux-kernel 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <83f8ef32-9060-4fde-b947-926ec1d830c8@0upti.me>]
* Re: [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 [not found] ` <83f8ef32-9060-4fde-b947-926ec1d830c8@0upti.me> @ 2024-10-23 14:01 ` Matthieu Baerts 0 siblings, 0 replies; 4+ messages in thread From: Matthieu Baerts @ 2024-10-23 14:01 UTC (permalink / raw) To: Ilya Katsnelson, Pablo Neira Ayuso, Jozsef Kadlecsik, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Westphal, Sasha Levin Cc: netfilter-devel, coreteam, netdev, linux-kernel 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-23 14:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-18 15:45 [PATCH] netfliter: xtables: fix typo causing some targets to not load on IPv6 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 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®