Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Label /dev/vhost-vdpa-[0-7] as vhost_device_t #517

Merged
merged 1 commit into from Jan 4, 2021

Conversation

zpytela
Copy link
Contributor

@zpytela zpytela commented Dec 16, 2020

To support the change, a set of appropriate file transitions
were added to the dev_filetrans_all_named_dev() interface.

Resolves: rhbz#1907485

Copy link
Member

@WOnder93 WOnder93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

@zpytela
Copy link
Contributor Author

zpytela commented Dec 16, 2020

I'd like to have clarified first how many interfaces will really be needed, that's why I made this PR a draft.

@WOnder93
Copy link
Member

I see... According to the kernel code it seems there can be up to VHOST_VDPA_DEV_MAX such devices, which is 1 << 20... That's way too many to cover them all, and we can't have too many filename transitions so I'd go with just 8 or 10. Though maybe we could make at least the fc regex match all of them (/dev/vhost-vdpa-[0-9]+).

I need to seriously look at finally adding some prefix matching to filename transitions...

@zpytela
Copy link
Contributor Author

zpytela commented Dec 17, 2020

Regexp and commit message updated.

@zpytela zpytela marked this pull request as ready for review December 17, 2020 18:51
Virtual data path acceleration (vDPA) is a new feature in libvirt.
With this selinux-policy commit, a particular file context specification
for the new device files were added to the policy, same as for other
vhost entries in /dev.
To support the change, a set of appropriate file transitions for instances
number [0-7] were added to the dev_filetrans_all_named_dev() interface.

Especially note that the VHOST_VDPA_DEV_MAX limit in kernel is set
to "1 << 20". While the default file context specification in SELinux
can be set using a regular expression, i. e. for unlimited number
of interface names, the transitions need to be enumerated, so they are
specified for numbers [0-7] only.

Resolves: rhbz#1907485
@zpytela zpytela merged commit a13a142 into fedora-selinux:rawhide Jan 4, 2021
@zpytela zpytela deleted the fb-vhost-vdpa branch January 4, 2021 16:43
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.

None yet

2 participants