netfilter: conntrack_irc: fix possible out-of-bounds read
Subsystems (2)
Florian Westphal
maintainerPATCH 1/1 netfilter: conntrack_irc: fix possible out-of-bounds read
When parsing fails after we've matched the command string we should bail out instead of trying to match a different command.
This helper should be deprecated, given prevalence of TLS I doubt it has any relevance in 2026.
Fixes 869f37d8e48f ("[NETFILTER]: nf_conntrack/nf_nat: add IRC helper port")
Signed-off-by Florian Westphal <[email protected]>
---
Noticed as part of a drive-by-review of another unrelated change.
net/netfilter/nf_conntrack_irc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_conntrack_irc.c +2 -2
@@ -203,7 +203,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,if (parse_dcc (data, data_limit, &dcc_ip, &dcc_port, &addr_beg_p, &addr_end_p)) {pr_debug ("unable to parse dcc command\n" ); -continue ; + goto out; } pr_debug("DCC bound ip/port: %pI4:%u\n",
@@ -217,7 +217,7 @@ static int help(struct sk_buff *skb, unsigned int protoff,net_warn_ratelimited ("Forged DCC command from %pI4: %pI4:%u\n" , &tuple->src.u3.ip, &dcc_ip, dcc_port); -continue ; + goto out; } exp =nf_ct_expect_alloc (ct);
Signature · 1 line
2.53.0
Quoted 9 lines · Florian Westphal
When parsing fails after we've matched the command string we should bail out instead of trying to match a different command.
This helper should be deprecated, given prevalence of TLS I doubt it has any relevance in 2026.
Fixes 869f37d8e48f ("[NETFILTER]: nf_conntrack/nf_nat: add IRC helper port")Signed-off-by Florian Westphal <[email protected]>
Reviewed-by Fernando Fernandez Mancera <[email protected]>