Skip to content

migration: add missing post-load bounds checks across devices

lbyxiaolizi qemu-devel qemu-riscv 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9util/fifo8: check head and num bounds in post_loadutil/fifo8.c+15 -00 replies
2/9hw/nvram/fw_cfg: reset out-of-range cur_entry in post_loadhw/nvram/fw_cfg.c+18 -00 replies
3/9hw/audio/hda-codec: mask stream and channel IDs in post_loadhw/audio/hda-codec.c+10 -00 replies
4/9hw/hyperv/vmbus: check seen_gfns <= num_gfns in gpadl post_loadhw/hyperv/vmbus.c+11 -00 replies
5/9hw/hyperv/vmbus: check rx_queue head and size in post_loadhw/hyperv/vmbus.c+12 -00 replies
6/9hw/pci/pcie_sriov: clamp NumVFs to TotalVFs in register_vfshw/pci/pcie_sriov.c+7 -00 replies
7/9hw/char/sifive_uart: check rx_fifo_len in post_loadhw/char/sifive_uart.c+12 -00 replies
8/9hw/char/ipoctal232: check channel FIFO indices in post_loadhw/char/ipoctal232.c+13 -00 replies
9/9hw/i386/vmmouse: check nb_queue bound in post_loadhw/i386/vmmouse.c+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] migration: add missing post-load bounds checks across devices

Several VMState descriptions restore array indices, ring heads or FIFO lengths directly from the migration stream without re-checking the bounds that runtime register writes enforce. If a migration stream or snapshot carries an out-of-range value, subsequent device callbacks can index past the corresponding array or buffer.

This series adds the missing post-load checks for Fifo8, fw_cfg, hda-codec, Hyper-V VMBus (GPADL and rx_queue), pcie_sriov, sifive_uart, ipoctal232, and vmmouse.

lbyxiaolizi (9):
util/fifo8: check head and num bounds in post_load hw/nvram/fw_cfg: reset out-of-range cur_entry in post_load hw/audio/hda-codec: mask stream and channel IDs in post_load hw/hyperv/vmbus: check seen_gfns <= num_gfns in gpadl post_load hw/hyperv/vmbus: check rx_queue head and size in post_load hw/pci/pcie_sriov: clamp NumVFs to TotalVFs in register_vfs hw/char/sifive_uart: check rx_fifo_len in post_load hw/char/ipoctal232: check channel FIFO indices in post_load hw/i386/vmmouse: check nb_queue bound in post_load

 hw/audio/hda-codec.c  | 10 ++++++++++
 hw/char/ipoctal232.c  | 13 +++++++++++++
 hw/char/sifive_uart.c | 12 ++++++++++++
 hw/hyperv/vmbus.c     | 23 +++++++++++++++++++++++
 hw/i386/vmmouse.c     |  4 ++++
 hw/nvram/fw_cfg.c     | 18 ++++++++++++++++++
 hw/pci/pcie_sriov.c   |  7 +++++++
 util/fifo8.c          | 15 +++++++++++++++
 8 files changed, 102 insertions(+)

base-commit: 61436f5ff1c4e5ee8f60fa1a37962a60f73ea7a4