Page MenuHomeFreeBSD

vmm.4: Add information on VM access control
Needs ReviewPublic

Authored by markj on Fri, Jan 16, 4:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 31, 4:09 AM
Unknown Object (File)
Thu, Jan 29, 7:14 AM
Unknown Object (File)
Thu, Jan 29, 7:10 AM
Unknown Object (File)
Sun, Jan 25, 12:42 PM
Unknown Object (File)
Sun, Jan 25, 11:26 AM
Unknown Object (File)
Sun, Jan 25, 11:21 AM
Unknown Object (File)
Sun, Jan 25, 11:21 AM
Unknown Object (File)
Sun, Jan 25, 8:21 AM

Details

Reviewers
bnovkov
Group Reviewers
bhyve
Summary

Add a section to vmm.4 explaining how vmm device file ownership works.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69927
Build 66810: arc lint + arc unit

Event Timeline

share/man/man4/vmm.4
85

Given the changes in D54739, should we perhaps add an explicit disclaimer about PCI passthrough not being supported for unprivileged users?
From what I can tell, trying to run an unprivileged VM with pci passthrough won't print any warnings about not being able to open /dev/pci, and I can already see new bug reports about this.

share/man/man4/vmm.4
85

Yes, that's a good point. I should make passthru_init() print a message when it fails due to lack of permissions.

I also realized after the fact that pci_lpc_get_sel() will fail with unprivileged bhyve, but the info it's fetching is available to unprivileged users via PCIOCGETCONF. We should rewrite that code to use PCIOCGETCONF instead.

rew added inline comments.
share/man/man4/vmm.4
85

Yes, that's a good point. I should make passthru_init() print a message when it fails due to lack of permissions.

wonder if its worth having a block of sanity-checks specific to provide normal users with fine-grained error messages?

if (normal_user)
   is_bhyve_in_monitor_mode()
   is_passthru_being_requested()
   is_user_in_vmm_group()

I did notice the error message you already have for monitor mode...that was helpful hint when I tested this out

I also realized after the fact that pci_lpc_get_sel() will fail with unprivileged bhyve, but the info it's fetching is available to unprivileged users via PCIOCGETCONF. We should rewrite that code to use PCIOCGETCONF instead.

yea, I saw this warning when I tried this out...the review https://reviews.freebsd.org/D39311 that brought the warning in made it sound like a somewhat expected scenario

I was gonna look into further it but I'm glad you mentioned the future fix here

Modify the PCI PASSTHROUGH section to note that the feature is
unavailable to unprivileged or jailed users.

Add some info to bhyve.8 as well.

share/man/man4/vmm.4
67

You're using Va here but nothing in bhyve.8

Use consistent formatting for the group name.