public inbox for netfilter-devel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: Jenny Guanni Qu <qguanni@gmail.com>,
	kadlec@netfilter.org, netfilter-devel@vger.kernel.org,
	klaudia@vidocsecurity.com, dawid@vidocsecurity.com
Subject: Re: [PATCH v2] netfilter: nf_conntrack_sip: add bounds-checked port parsing helper
Date: Wed, 1 Apr 2026 01:32:57 +0200	[thread overview]
Message-ID: <acxZqXOhFDulHuqS@chamomile> (raw)
In-Reply-To: <abSfgVpCQcFWwNEs@strlen.de>

Hi,

On Sat, Mar 14, 2026 at 12:36:33AM +0100, Florian Westphal wrote:
> Jenny Guanni Qu <qguanni@gmail.com> wrote:
> > +	/* reached limit while parsing port */
> > +	if (dptr >= limit)
> > +		return false;
> > +
> > +	if (port) {
> > +		if (p < 1024 || p > 65535)
> > +			return false;
> > +		*port = htons(p);
> > +	}
> 
> I like the port range check, but should we make this universal?
> 
> 	if (p < 1024 || p > 65535)
> 		return false;
> 	if (port)
> 		*port = htons(p);
> 
> ?

Can anyone have a look into following up on this?

Otherwise, I will try to have a look for the next PR with fixes.

  reply	other threads:[~2026-03-31 23:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 19:52 [PATCH v2] netfilter: nf_conntrack_sip: add bounds-checked port parsing helper Jenny Guanni Qu
2026-03-13 23:36 ` Florian Westphal
2026-03-31 23:32   ` Pablo Neira Ayuso [this message]
2026-04-02 12:52   ` Florian Westphal

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=acxZqXOhFDulHuqS@chamomile \
    --to=pablo@netfilter.org \
    --cc=dawid@vidocsecurity.com \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=klaudia@vidocsecurity.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=qguanni@gmail.com \
    /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