From: Pablo Neira Ayuso <pablo@netfilter.org>
To: HACKE-RC <rc@rexion.ai>
Cc: Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 3/4] netfilter: nf_conntrack_amanda: use nf_ct_helper_parse_port()
Date: Mon, 7 Sep 2026 18:39:38 +0200 [thread overview]
Message-ID: <ap7oygJrnJ0YcE7V@chamomile> (raw)
In-Reply-To: <20260503083220.630655-4-rc@rexion.ai>
Hi Raoul,
On Sun, May 03, 2026 at 02:02:19PM +0530, HACKE-RC wrote:
> Replace simple_strtoul() with the new nf_ct_helper_parse_port() helper.
> This removes the dependency on NUL-terminated strings and adds an
> explicit port range check, rejecting port 0 and values above 65535.
>
> Fixes: 16958900578b ("netfilter: nf_conntrack_amanda: the match is called 'amanda', not 'AMANDA'")
> Signed-off-by: HACKE-RC <rc@rexion.ai>
We need a real name here, please target this to the nf/nf-next trees.
Thanks.
> ---
> net/netfilter/nf_conntrack_amanda.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/net/netfilter/nf_conntrack_amanda.c b/net/netfilter/nf_conntrack_amanda.c
> index d2c09e8dd..30b5c4b84 100644
> --- a/net/netfilter/nf_conntrack_amanda.c
> +++ b/net/netfilter/nf_conntrack_amanda.c
> @@ -88,11 +88,12 @@ static int amanda_help(struct sk_buff *skb,
> struct nf_conntrack_expect *exp;
> struct nf_conntrack_tuple *tuple;
> unsigned int dataoff, start, stop, off, i;
> + nf_nat_amanda_hook_fn *nf_nat_amanda;
> char pbuf[sizeof("65535")], *tmp;
> + int ret = NF_ACCEPT;
> u_int16_t len;
> + u16 parsed_port;
> __be16 port;
> - int ret = NF_ACCEPT;
> - nf_nat_amanda_hook_fn *nf_nat_amanda;
>
> /* Only look at packets from the Amanda server */
> if (CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL)
> @@ -132,10 +133,10 @@ static int amanda_help(struct sk_buff *skb,
> break;
> pbuf[len] = '\0';
>
> - port = htons(simple_strtoul(pbuf, &tmp, 10));
> - len = tmp - pbuf;
> - if (port == 0 || len > 5)
> + if (nf_ct_helper_parse_port(pbuf, len, &parsed_port, &tmp))
> break;
> + port = htons(parsed_port);
> + len = tmp - pbuf;
>
> exp = nf_ct_expect_alloc(ct);
> if (exp == NULL) {
> --
> 2.54.0
>
next prev parent reply other threads:[~2026-09-07 16:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 6:31 [PATCH net-next v2 0/3] netfilter: conntrack: add shared port parser and use it in IRC and Amanda helpers HACKE-RC
2026-05-01 6:31 ` [PATCH net-next v2 1/3] netfilter: conntrack: add shared port parser for helpers HACKE-RC
2026-05-01 10:25 ` Phil Sutter
2026-05-01 6:31 ` [PATCH net-next v2 2/3] netfilter: nf_conntrack_irc: use nf_ct_helper_parse_port() HACKE-RC
2026-05-01 6:31 ` [PATCH net-next v2 3/3] netfilter: nf_conntrack_amanda: " HACKE-RC
2026-05-01 10:34 ` [PATCH net-next v2 0/3] netfilter: conntrack: add shared port parser and use it in IRC and Amanda helpers Phil Sutter
2026-05-03 8:32 ` [PATCH net-next v3 0/4] netfilter: conntrack: shared port parser for helpers HACKE-RC
2026-05-03 8:32 ` [PATCH net-next v3 1/4] netfilter: conntrack: add shared port and uint parsers " HACKE-RC
2026-05-05 22:33 ` Pablo Neira Ayuso
2026-05-24 11:14 ` Rahul
2026-05-03 8:32 ` [PATCH net-next v3 2/4] netfilter: nf_conntrack_irc: use nf_ct_helper_parse_port() HACKE-RC
2026-05-03 8:32 ` [PATCH net-next v3 3/4] netfilter: nf_conntrack_amanda: " HACKE-RC
2026-09-07 16:39 ` Pablo Neira Ayuso [this message]
2026-05-03 8:32 ` [PATCH net-next v3 4/4] netfilter: nf_conntrack_sip: " HACKE-RC
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ap7oygJrnJ0YcE7V@chamomile \
--to=pablo@netfilter.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=phil@nwl.cc \
--cc=rc@rexion.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®