|
| 1 | +From 02d6d4a741619b0bc8f29705d0f59aac596a9bf6 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 3 | +Date: Mon, 28 Oct 2024 07:25:38 +0100 |
| 4 | +Subject: [PATCH 49/79] netfilter: xtables: fix typo causing some targets not |
| 5 | + to load on IPv6 |
| 6 | +MIME-Version: 1.0 |
| 7 | +Content-Type: text/plain; charset=UTF-8 |
| 8 | +Content-Transfer-Encoding: 8bit |
| 9 | + |
| 10 | +5.15-stable review patch. If anyone has any objections, please let me know. |
| 11 | + |
| 12 | +------------------ |
| 13 | + |
| 14 | +From: Pablo Neira Ayuso <pablo@netfilter.org> |
| 15 | + |
| 16 | +[ Upstream commit 306ed1728e8438caed30332e1ab46b28c25fe3d8 ] |
| 17 | + |
| 18 | +- There is no NFPROTO_IPV6 family for mark and NFLOG. |
| 19 | +- TRACE is also missing module autoload with NFPROTO_IPV6. |
| 20 | + |
| 21 | +This results in ip6tables failing to restore a ruleset. This issue has been |
| 22 | +reported by several users providing incomplete patches. |
| 23 | + |
| 24 | +Very similar to Ilya Katsnelson's patch including a missing chunk in the |
| 25 | +TRACE extension. |
| 26 | + |
| 27 | +Fixes: 0bfcb7b71e73 ("netfilter: xtables: avoid NFPROTO_UNSPEC where needed") |
| 28 | +Reported-by: Ignat Korchagin <ignat@cloudflare.com> |
| 29 | +Reported-by: Ilya Katsnelson <me@0upti.me> |
| 30 | +Reported-by: Krzysztof Olędzki <ole@ans.pl> |
| 31 | +Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> |
| 32 | +Signed-off-by: Sasha Levin <sashal@kernel.org> |
| 33 | +--- |
| 34 | + net/netfilter/xt_NFLOG.c | 2 +- |
| 35 | + net/netfilter/xt_TRACE.c | 1 + |
| 36 | + net/netfilter/xt_mark.c | 2 +- |
| 37 | + 3 files changed, 3 insertions(+), 2 deletions(-) |
| 38 | + |
| 39 | +diff --git a/net/netfilter/xt_NFLOG.c b/net/netfilter/xt_NFLOG.c |
| 40 | +index d80abd6cc..6dcf4bc7e 100644 |
| 41 | +--- a/net/netfilter/xt_NFLOG.c |
| 42 | ++++ b/net/netfilter/xt_NFLOG.c |
| 43 | +@@ -79,7 +79,7 @@ static struct xt_target nflog_tg_reg[] __read_mostly = { |
| 44 | + { |
| 45 | + .name = "NFLOG", |
| 46 | + .revision = 0, |
| 47 | +- .family = NFPROTO_IPV4, |
| 48 | ++ .family = NFPROTO_IPV6, |
| 49 | + .checkentry = nflog_tg_check, |
| 50 | + .destroy = nflog_tg_destroy, |
| 51 | + .target = nflog_tg, |
| 52 | +diff --git a/net/netfilter/xt_TRACE.c b/net/netfilter/xt_TRACE.c |
| 53 | +index f3fa4f113..a642ff09f 100644 |
| 54 | +--- a/net/netfilter/xt_TRACE.c |
| 55 | ++++ b/net/netfilter/xt_TRACE.c |
| 56 | +@@ -49,6 +49,7 @@ static struct xt_target trace_tg_reg[] __read_mostly = { |
| 57 | + .target = trace_tg, |
| 58 | + .checkentry = trace_tg_check, |
| 59 | + .destroy = trace_tg_destroy, |
| 60 | ++ .me = THIS_MODULE, |
| 61 | + }, |
| 62 | + #endif |
| 63 | + }; |
| 64 | +diff --git a/net/netfilter/xt_mark.c b/net/netfilter/xt_mark.c |
| 65 | +index f76fe04fc..65b965ca4 100644 |
| 66 | +--- a/net/netfilter/xt_mark.c |
| 67 | ++++ b/net/netfilter/xt_mark.c |
| 68 | +@@ -62,7 +62,7 @@ static struct xt_target mark_tg_reg[] __read_mostly = { |
| 69 | + { |
| 70 | + .name = "MARK", |
| 71 | + .revision = 2, |
| 72 | +- .family = NFPROTO_IPV4, |
| 73 | ++ .family = NFPROTO_IPV6, |
| 74 | + .target = mark_tg, |
| 75 | + .targetsize = sizeof(struct xt_mark_tginfo2), |
| 76 | + .me = THIS_MODULE, |
| 77 | +-- |
| 78 | +2.45.0 |
| 79 | + |
0 commit comments