* [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter
@ 2026-10-19 7:56 liuc63
2026-10-19 7:58 ` netdev-bot+sinfo
2026-10-19 8:42 ` Florian Westphal
0 siblings, 2 replies; 3+ messages in thread
From: liuc63 @ 2026-10-19 7:56 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: Florian Westphal, Phil Sutter, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Florent Fourcot,
Romain Bellan, Weibin Liu, netfilter-devel, coreteam, netdev,
Liu Chao, stable
From: Liu Chao <liuc63@xiaopeng.com>
ctnetlink_filter_match_tuple() returns 0 (no match) when the IPv6
source or destination address differs from the filter, because the
!ipv6_addr_cmp() test is inverted. ipv6_addr_cmp() returns 0 when
the addresses are equal, so the negation makes the branch trigger on
a match instead of a mismatch, which is the opposite of the IPv4
path above.
Drop the '!' so the IPv6 branch returns 0 only when the addresses
differ, matching the IPv4 semantics and the caller's expectation.
Fixes: cb8aa9a3affb ("netfilter: ctnetlink: add kernel side filtering for dump")
Cc: stable@vger.kernel.org
Reviewed-by: Weibin Liu <liuwb@xiaopeng.com>
Signed-off-by: Liu Chao <liuc63@xiaopeng.com>
---
net/netfilter/nf_conntrack_netlink.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 4e5d7c701436..cc8695d5356d 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -1098,13 +1098,13 @@ static int ctnetlink_filter_match_tuple(struct nf_conntrack_tuple *filter_tuple,
break;
case NFPROTO_IPV6:
if ((flags & CTA_FILTER_FLAG(CTA_IP_SRC)) &&
- !ipv6_addr_cmp(&filter_tuple->src.u3.in6,
- &ct_tuple->src.u3.in6))
+ ipv6_addr_cmp(&filter_tuple->src.u3.in6,
+ &ct_tuple->src.u3.in6))
return 0;
if ((flags & CTA_FILTER_FLAG(CTA_IP_DST)) &&
- !ipv6_addr_cmp(&filter_tuple->dst.u3.in6,
- &ct_tuple->dst.u3.in6))
+ ipv6_addr_cmp(&filter_tuple->dst.u3.in6,
+ &ct_tuple->dst.u3.in6))
return 0;
break;
}
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter
2026-10-19 7:56 [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter liuc63
@ 2026-10-19 7:58 ` netdev-bot+sinfo
2026-10-19 8:42 ` Florian Westphal
1 sibling, 0 replies; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-10-19 7:58 UTC (permalink / raw)
To: liuc63
Cc: Pablo Neira Ayuso, Florian Westphal, Phil Sutter, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman,
Florent Fourcot, Romain Bellan, Weibin Liu, netfilter-devel,
coreteam, netdev, stable
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter
2026-10-19 7:56 [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter liuc63
2026-10-19 7:58 ` netdev-bot+sinfo
@ 2026-10-19 8:42 ` Florian Westphal
1 sibling, 0 replies; 3+ messages in thread
From: Florian Westphal @ 2026-10-19 8:42 UTC (permalink / raw)
To: liuc63
Cc: Pablo Neira Ayuso, Phil Sutter, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Florent Fourcot,
Romain Bellan, Weibin Liu, netfilter-devel, coreteam, netdev,
stable
liuc63 <liuc63@xiaopeng.com> wrote:
> From: Liu Chao <liuc63@xiaopeng.com>
>
> ctnetlink_filter_match_tuple() returns 0 (no match) when the IPv6
> source or destination address differs from the filter, because the
> !ipv6_addr_cmp() test is inverted. ipv6_addr_cmp() returns 0 when
> the addresses are equal, so the negation makes the branch trigger on
> a match instead of a mismatch, which is the opposite of the IPv4
> path above.
>
> Drop the '!' so the IPv6 branch returns 0 only when the addresses
> differ, matching the IPv4 semantics and the caller's expectation.
Reviewed-by: Florian Westphal <fw@strlen.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-19 8:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 7:56 [PATCH] netfilter: nf_conntrack_netlink: fix inverted IPv6 tuple filter liuc63
2026-10-19 7:58 ` netdev-bot+sinfo
2026-10-19 8:42 ` Florian Westphal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox