opnsense-src/usr.sbin/bhyve
Chuck Tuffli a7761d19da bhyve: Fix NVMe iovec construction for large IOs
The UEFI driver included with Rocky Linux 8.4 uncovered an existing bug
in the NVMe emulation's construction of iovec's.

By default, NVMe data transfer operations use a scatter-gather list in
which all entries point to a fixed size memory region. For example, if
the Memory Page Size is 4KiB, a 2MiB IO requires 512 entries. Lists
themselves are also fixed size (default is 512 entries).

Because the list size is fixed, the last entry is special. If the IO
requires more than 512 entries, the last entry in the list contains the
address of the next list of entries. But if the IO requires exactly 512
entries, the last entry points to data.

The NVMe emulation missed this logic and unconditionally treated the
last entry as a pointer to the next list. Fix is to check if the
remaining data is greater than the page size before using the last entry
as a pointer to the next list.

PR:		256422
Reported by:	dave@syix.com
Tested by:	jason@tubnor.net
Relnotes:	yes

(cherry picked from commit 91064841d7)
2021-07-09 07:24:14 -07:00
..
acpi.c bhyve(8): Add VM Generation Counter ACPI device 2020-04-15 02:00:17 +00:00
acpi.h bhyve(8): Add VM Generation Counter ACPI device 2020-04-15 02:00:17 +00:00
ahci.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
atkbdc.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
atkbdc.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
audio.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
audio.h Add SPDX tags to bhyve(8) HD Audio device. 2019-06-25 06:24:56 +00:00
bhyve.8 Fix manpage markup in 2c8bb126de 2021-01-21 20:32:15 +00:00
bhyvegc.c When this code was introduced at r300829 the author forgot to add 2018-06-13 04:00:21 +00:00
bhyvegc.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
bhyverun.c Remove bvmconsole and bvmdebug. 2020-12-23 17:15:23 -09:00
bhyverun.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
block_if.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
block_if.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
bootrom.c bhyve(8): Add bootrom allocation abstraction 2020-04-15 01:58:51 +00:00
bootrom.h bhyve(8): Add bootrom allocation abstraction 2020-04-15 01:58:51 +00:00
console.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
console.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
debug.h bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
fwctl.c Always treat firmware request and response sizes as unsigned. 2018-12-04 18:28:25 +00:00
fwctl.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
gdb.c bhyve: Set SO_REUSEADDR on the gdb stub socket 2021-05-10 09:35:04 -04:00
gdb.h Support software breakpoints in the debug server on Intel CPUs. 2019-12-13 19:21:58 +00:00
hda_codec.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
hda_reg.h Add SPDX tags to bhyve(8) HD Audio device. 2019-06-25 06:24:56 +00:00
hdac_reg.h Add SPDX tags to bhyve(8) HD Audio device. 2019-06-25 06:24:56 +00:00
inout.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
inout.h Remove bvmconsole and bvmdebug. 2020-12-23 17:15:23 -09:00
ioapic.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ioapic.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
iov.c bhyve: enable virtio-net mergeable rx buffers for tap(4) 2020-02-20 21:07:23 +00:00
iov.h bhyve: enable virtio-net mergeable rx buffers for tap(4) 2020-02-20 21:07:23 +00:00
kernemu_dev.c vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace 2020-05-15 15:54:22 +00:00
kernemu_dev.h vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace 2020-05-15 15:54:22 +00:00
Makefile bhyve: fix build without casper/capsicum support 2021-01-03 18:17:04 +01:00
Makefile.depend Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
Makefile.depend.options Add Makefile.depend.options 2019-12-11 17:37:37 +00:00
mem.c Add support for writing to guest memory in the debug server. 2019-05-24 00:34:13 +00:00
mem.h Add support for writing to guest memory in the debug server. 2019-05-24 00:34:13 +00:00
mevent.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
mevent.h bhyve: add backend rx backpressure to virtio-net 2019-11-03 19:02:32 +00:00
mevent_test.c Improve bhyve exit(3) error code. 2018-07-11 03:23:09 +00:00
mptbl.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
mptbl.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
net_backends.c bhyve: Fix processing of netgraph backend options. 2020-05-15 11:03:27 +00:00
net_backends.h bhyve: Pass the full string of options to the network backends. 2020-05-08 17:15:54 +00:00
net_utils.c Add VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device. 2020-04-07 17:06:33 +00:00
net_utils.h Add VIRTIO_NET_F_MTU flag support for the bhyve virtio-net device. 2020-04-07 17:06:33 +00:00
pci_ahci.c Fix regression in AHCI controller settings. 2020-11-15 12:59:24 +00:00
pci_e82545.c bhyve: Update TX descriptor base address and host mapping on change 2020-10-16 20:27:20 +00:00
pci_emul.c bhyve: support relocating fbuf and passthru data BARs 2021-03-26 21:50:41 +08:00
pci_emul.h bhyve: support relocating fbuf and passthru data BARs 2021-03-26 21:50:41 +08:00
pci_fbuf.c bhyve: support relocating fbuf and passthru data BARs 2021-03-26 21:50:41 +08:00
pci_hda.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
pci_hda.h bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
pci_hostbridge.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
pci_irq.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pci_irq.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pci_lpc.c Support COM3 and COM4 serial ports. 2021-01-20 03:30:22 +10:00
pci_lpc.h Add -s "help" and -l "help" to print a list of supported PCI and LPC devices. 2018-08-22 20:23:08 +00:00
pci_nvme.c bhyve: Fix NVMe iovec construction for large IOs 2021-07-09 07:24:14 -07:00
pci_passthru.c bhyve: support relocating fbuf and passthru data BARs 2021-03-26 21:50:41 +08:00
pci_uart.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
pci_virtio_9p.c Add virtio-9p (aka VirtFS) filesystem sharing to bhyve. 2020-10-03 19:05:13 +00:00
pci_virtio_block.c VirtIO: Make sure the guest knows the TRIM alignment requirements 2020-11-05 17:10:14 +00:00
pci_virtio_console.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
pci_virtio_net.c [bhyve] virtio-net: Do not allow receiving packets until features have been negotiated. 2020-12-17 16:52:40 +00:00
pci_virtio_rnd.c bhyve: Add snapshot support for virtio-rnd. 2020-11-28 04:06:09 +00:00
pci_virtio_scsi.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
pci_xhci.c bhyve: 'xhci,tablet' snapshot fixes 2020-11-28 03:54:48 +00:00
pci_xhci.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
pctestdev.c Add legacy debug/test interfaces for kvm unit tests. 2020-11-17 13:14:04 +00:00
pctestdev.h Add legacy debug/test interfaces for kvm unit tests. 2020-11-17 13:14:04 +00:00
pm.c Silence ACPI RTC error/warning in Linux guests. 2020-07-06 08:36:14 +00:00
post.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
ps2kbd.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
ps2kbd.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
ps2mouse.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
ps2mouse.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
rfb.c Fix issues with various VNC clients. 2020-12-18 00:38:48 +00:00
rfb.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
rtc.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
rtc.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
smbiostbl.c bhyve: add SMBIOS Baseboard Information 2021-06-28 08:48:26 -07:00
smbiostbl.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
snapshot.c Remove bvmconsole and bvmdebug. 2020-12-23 17:15:23 -09:00
snapshot.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
sockstream.c Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
sockstream.h Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
spinup_ap.c various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
spinup_ap.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00
task_switch.c bhyve: add wrapper for debug printf statements 2020-01-08 22:55:22 +00:00
uart_emul.c Support COM3 and COM4 serial ports. 2021-01-20 03:30:22 +10:00
uart_emul.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
usb_emul.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
usb_emul.h Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
usb_mouse.c Fix byte-reversal of language ID in string descriptor. 2020-09-18 05:54:59 +00:00
vga.c Add SPDX tags to bhyve(8). 2018-06-13 03:22:08 +00:00
vga.h Fix style(9) space vs tab. 2018-06-14 01:34:53 +00:00
virtio.c Initial support for bhyve save and restore. 2020-05-05 00:02:04 +00:00
virtio.h Add virtio-9p (aka VirtFS) filesystem sharing to bhyve. 2020-10-03 19:05:13 +00:00
vmgenc.c bhyve(8): Correct copyright boilerplate for r359950 2020-04-15 05:55:14 +00:00
vmgenc.h bhyve(8): Correct copyright boilerplate for r359950 2020-04-15 05:55:14 +00:00
xmsr.c bhyve: implement rdmsr for MSR_IA32_FEATURE_CONTROL 2021-06-28 20:08:56 +10:00
xmsr.h various: general adoption of SPDX licensing ID tags. 2017-11-27 15:37:16 +00:00