Skip to content

hw/net: fix rx_desc_len on migration load

Laurent Vivier qemu-devel 2 versions – Applied

Status from this message: Queued via hw-misc, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesApplied
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- extract e1000e_calc_rxconf() to recalculate all derived RX values
- fix commit message to mention both RFCTL and RCTL
- fix commit message to note that igb_rx_use_legacy_descriptor() is currently a stub

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2hw/net/e1000e: recalculate rx_desc_len on migration loadhw/net/e1000e_core.c+13 -50 replies
2/2hw/net/igb: recalculate rx_desc_len on migration loadhw/net/igb_core.c+2 -00 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAkihiko Odaki
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] hw/net: fix rx_desc_len on migration load

rx_desc_len is migrated as a raw uint8_t from the stream in both e1000e and igb, but it is a derived value that can be computed from the register state. A crafted migration stream can set rx_desc_len to an invalid value, causing a stack buffer overflow in e1000e_write_packet_to_guest() which copies rx_desc_len bytes into a 32-byte stack union.

Recalculate rx_desc_len from the register state in post_load, ignoring the untrusted value from the stream.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3869

v2:
- extract e1000e_calc_rxconf() to recalculate all derived RX values
- fix commit message to mention both RFCTL and RCTL
- fix commit message to note that igb_rx_use_legacy_descriptor() is currently a stub

Laurent Vivier (2):
hw/net/e1000e: recalculate rx_desc_len on migration load hw/net/igb: recalculate rx_desc_len on migration load

 hw/net/e1000e_core.c | 18 +++++++++++++-----
 hw/net/igb_core.c    |  2 ++
 2 files changed, 15 insertions(+), 5 deletions(-)
Signature · 1 line
2.54.0