From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top, Matt Hamilton <matt@thmail.io>
Subject: Re: [PATCH] flow: Don't crash if guest attempts to connect to port 0
Date: Wed, 14 Aug 2024 13:03:57 +0200 [thread overview]
Message-ID: <20240814130357.47da30ce@elisabeth> (raw)
In-Reply-To: <20240814100333.706977-1-david@gibson.dropbear.id.au>
On Wed, 14 Aug 2024 20:03:33 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:
> Using a zero port on TCP or UDP is dubious, and we can't really deal with
> forwarding such a flow within the constraints of the socket API. Hence
> we ASSERT()ed that we had non-zero ports in flow_hash().
>
> The intention was to make sure that the protocol code sanitizes such ports
> before completing a flow entry. Unfortunately, flow_hash() is also called
> on new packets to see if they have an existing flow, so the unsanitized
> guest packet can crash passt with the assert.
>
> Correct this by moving the assert from flow_hash() to flow_sidx_hash()
> which is only used on entries already in the table, not on unsanitized
> data.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied, with:
Reported-by: Matt Hamilton <matt@thmail.io>
--
Stefano
prev parent reply other threads:[~2024-08-14 11:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 10:03 [PATCH] flow: Don't crash if guest attempts to connect to port 0 David Gibson
2024-08-14 11:03 ` Stefano Brivio [this message]
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=20240814130357.47da30ce@elisabeth \
--to=sbrivio@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=matt@thmail.io \
--cc=passt-dev@passt.top \
/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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).