qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Dmitry Fleytman <dmitry.fleytman@gmail.com>,
	Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	Jason Wang <jasowang@redhat.com>
Subject: [PATCH 0/3] hw/net/e1000e: Fix assertion failures in e1000e_write_payload_frag_to_rx_buffers()
Date: Mon,  3 Nov 2025 17:58:48 +0000	[thread overview]
Message-ID: <20251103175851.428816-1-peter.maydell@linaro.org> (raw)

This patchset fixes assertion failures in
e1000e_write_payload_frag_to_rx_buffers().  There turn out to be two
ways this assert could be triggered.

The first is the one reported in
https://gitlab.com/qemu-project/qemu/-/issues/537 where a malicious
guest could set up the device into loopback mode and then send a
carefully sized packet that trips a bug in the logic in
e1000e_write_packet_to_guest() that tries to calculate how much data
it is going to put into an RX descriptor, causing us to hit the
assertion.

The second is one I spotted by code inspection, where the assert is
slightly over-eager and could assert in one valid case of a just
exactly large enough packet.

Patch 1 fixes what I believe to be an incorrect-behaviour bug
for descriptors with NULL buffer addresses, largely because
that makes the following patch to fix the assertion less awkward.

thanks
-- PMM

Peter Maydell (3):
  hw/net/e1000e_core: Don't advance desc_offset for NULL buffer RX
    descriptors
  hw/net/e1000e_core: Correct rx oversize packet checks
  hw/net/e1000e_core: Adjust e1000e_write_payload_frag_to_rx_buffers()
    assert

 hw/net/e1000e_core.c | 85 ++++++++++++++++++++++++++++++--------------
 1 file changed, 59 insertions(+), 26 deletions(-)

-- 
2.43.0



             reply	other threads:[~2025-11-03 18:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03 17:58 Peter Maydell [this message]
2025-11-03 17:58 ` [PATCH 1/3] hw/net/e1000e_core: Don't advance desc_offset for NULL buffer RX descriptors Peter Maydell
2025-11-04  6:11   ` Akihiko Odaki
2025-11-04  9:55     ` Peter Maydell
2025-11-04 16:44   ` Philippe Mathieu-Daudé
2025-11-03 17:58 ` [PATCH 2/3] hw/net/e1000e_core: Correct rx oversize packet checks Peter Maydell
2025-11-07  3:50   ` Jason Wang
2025-11-07 10:06     ` Peter Maydell
2025-11-03 17:58 ` [PATCH 3/3] hw/net/e1000e_core: Adjust e1000e_write_payload_frag_to_rx_buffers() assert Peter Maydell
2025-11-05  6:21 ` [PATCH 0/3] hw/net/e1000e: Fix assertion failures in e1000e_write_payload_frag_to_rx_buffers() Akihiko Odaki

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=20251103175851.428816-1-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=dmitry.fleytman@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).