Skip to content

enable userspace port I/O for hypercalls in guest - #32

Open
thejh wants to merge 1 commit into
nyx-fuzz:mainfrom
thejh:ioperm-for-hypercall
Open

enable userspace port I/O for hypercalls in guest#32
thejh wants to merge 1 commit into
nyx-fuzz:mainfrom
thejh:ioperm-for-hypercall

Conversation

@thejh

@thejh thejh commented May 9, 2025

Copy link
Copy Markdown

Use ioperm() to explicitly allow port I/O to the port used for Nyx hypercalls. With this, the host kernel no longer needs to enable enable_vmware_backdoor=y.

Benefits:

  • It avoids needing to change system-wide host configuration.
  • It lets KVM avoid intercepting guest #GP and decoding every instruction that hits #GP.

Downsides:

  • Some stuff in the guest kernel will hit slowpaths; in particular, the syscall return path will probably run a few instructions more (tss_update_io_bitmap()).

Switching between multiple tasks with separately-created ioperm() bitmasks would probably be slow because we'd hit the memcpy() in tss_copy_io_bitmap(), but as long as we just set up a single ioperm() bitmask in init, that shouldn't happen.

With this patch applied, I can use afl-fuzz in Nyx mode without enabling enable_vmware_backdoor.

Use ioperm() to explicitly allow port I/O to the port used for Nyx
hypercalls. With this, the host kernel no longer needs to enable
enable_vmware_backdoor=y.

Benefits:

 - It avoids needing to change system-wide host configuration.
 - It lets KVM avoid intercepting guest #GP and decoding every instruction
   that hits #GP.

Downsides:

 - Some stuff in the guest kernel will hit slowpaths; in particular,
   the syscall return path will probably run a few instructions more
   (tss_update_io_bitmap()).

Switching between multiple tasks with separately-created ioperm()
bitmasks would probably be slow because we'd hit the memcpy() in
tss_copy_io_bitmap(), but as long as we just set up a single ioperm()
bitmask in init, that shouldn't happen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant