]> git.itanic.dy.fi Git - linux-stable/commit
netfilter: nf_conntrack_irc: Fix forged IP logic
authorDavid Leadbeater <dgl@dgl.cx>
Fri, 26 Aug 2022 04:56:58 +0000 (14:56 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 10:17:05 +0000 (12:17 +0200)
commit3275f7804f40de3c578d2253232349b07c25f146
tree5f56fdf67a600208689acc68b4540acfb043e6dc
parent89810dbbffff7efae8d83b39557a50a7dfc65b44
netfilter: nf_conntrack_irc: Fix forged IP logic

[ Upstream commit 0efe125cfb99e6773a7434f3463f7c2fa28f3a43 ]

Ensure the match happens in the right direction, previously the
destination used was the server, not the NAT host, as the comment
shows the code intended.

Additionally nf_nat_irc uses port 0 as a signal and there's no valid way
it can appear in a DCC message, so consider port 0 also forged.

Fixes: 869f37d8e48f ("[NETFILTER]: nf_conntrack/nf_nat: add IRC helper port")
Signed-off-by: David Leadbeater <dgl@dgl.cx>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nf_conntrack_irc.c