vmm's vm_set_register() should be more careful
markjdb opened this issue · 0 comments
markjdb commented
Right now, bhyve can use an ioctl to set the guest's PC to any address, with bounds inherited from the GVA root capability. This should be reworked to ensure that existing bounds are respected. In particular, I think vmm should do the following:
- During guest creation, initialize each vcpu's
nextpc
to a copy of the GVA root cap. - Require the caller of
VM_SET_REGISTER
to provide an untagged capability which can be derived from the currentnextpc
value. This should be enough to let bhyve setnextpc
before initial execution of guest code. - Optionally provide a mechanism to override this restriction, following, e.g.,
security.cheri.ptrace_caps
.