All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Jenny Guanni Qu <qguanni@gmail.com>
Cc: pablo@netfilter.org, 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: Sat, 14 Mar 2026 00:36:33 +0100	[thread overview]
Message-ID: <abSfgVpCQcFWwNEs@strlen.de> (raw)
In-Reply-To: <20260313195256.2783257-1-qguanni@gmail.com>

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);

?

  reply	other threads:[~2026-03-13 23:36 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 [this message]
2026-03-31 23:32   ` Pablo Neira Ayuso
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=abSfgVpCQcFWwNEs@strlen.de \
    --to=fw@strlen.de \
    --cc=dawid@vidocsecurity.com \
    --cc=kadlec@netfilter.org \
    --cc=klaudia@vidocsecurity.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.