microVM: refuse device buffers outside the e820 RAM ranges
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 18/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- linux
- Domain
- infrastructure
Research direction
Start with the "Memory layout" section of doc/design/cold-boot.md and section 2.3 of the architecture guide in #529 to learn the e820 RAM, MMIO aperture and reserved-range rules. The device work is in OpenVMM under the nanvix/openvmm submodule, in the virtio queue descriptor path or the guest-memory view given to microVM devices. Done means descriptors whose buffers cross the aperture or a reserved range, such as the page at 0x30000 or the ISA hole, are refused with a defined error completion or device reset, and OpenVMM tests cover those three cases.
Written by the indexing model from the issue text.
Description
Summary
The microVM memory layout requires that loader writes and DMA ranges fit wholly inside a RAM range and never cross the MMIO aperture or a reserved boot structure (section 2.3 of the architecture guide in doc/design/). The Linux direct loader meets this for its own writes. Device DMA does not: OpenVMM gives each microVM virtio device the whole guest memory, so a descriptor fails only when its buffer leaves guest RAM, for example in the MMIO aperture. A guest can point a device buffer at a range that the e820 map reserves inside RAM, such as the shared virtio interrupt-status page at 0x30000, which the devices themselves update, or the ISA hole.
The guest can already write those pages directly, so this does not weaken isolation between the guest and the host. The devices only enforce less than the layout states.
Intended behavior
Every buffer of a microVM virtio device lies wholly inside a RAM range of the e820 map. The device refuses a descriptor whose buffer crosses the MMIO aperture or a reserved range, such as the shared interrupt-status page, instead of reading or writing it.
Tasks
- Give the microVM virtio devices a guest-memory view, or a descriptor check in the virtio queue, that admits only the e820 RAM ranges, in OpenVMM in the
nanvix/openvmmsubmodule, and promote the pin. - Define how a device reports a refused buffer: an error completion where its protocol has one, or marking the device as needing reset.
- Add OpenVMM coverage for buffers in the interrupt-status page, in the ISA hole, and across the aperture.
- Note the enforcement in section 2.3 of the architecture guide.
- Dominant language
- Python
- Stars
- 408
- Forks
- 28
- Avg merge
- 13h 18m
- Merged PRs (30d)
- 292
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Track sandbox live share bugs: the time ABI bind hides or breaks shares at /run targetsPossibly taken @jay23606 claimed this 2 days ago. Openbug-hunt confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
Maintainers usually reply within 1 day
Similar issues
-
Examples say cnxOpendocumentation embedded
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Alishahryar1/free-claude-code#2111 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
namespace operations
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EclipseFdn/open-vsx.org#14373 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day