]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vmm: Add credential to cdev object
authorCyril Zhang <cyril@freebsdfoundation.org>
Wed, 18 Aug 2021 17:41:33 +0000 (13:41 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 1 Sep 2021 13:07:42 +0000 (09:07 -0400)
commit2d4c599e7d6a1890bd4794d8b3d43d8e182b42d4
tree45ade039464a18626c574e37730c51a67910b107
parent32d4139b3eb8a088add57a326e60ec8e7e2e8f08
vmm: Add credential to cdev object

Add a credential to the cdev object in sysctl_vmm_create(), then check
that we have the correct credentials in sysctl_vmm_destroy(). This
prevents a process in one jail from opening or destroying the /dev/vmm
file corresponding to a VM in a sibling jail.

Add regression tests.

Reviewed by: jhb, markj
Sponsored by: The FreeBSD Foundation

(cherry picked from commit a85404906bc8f402318524b4ccd196712fc09fbd)
etc/mtree/BSD.tests.dist
sys/amd64/vmm/vmm_dev.c
tests/sys/Makefile
tests/sys/vmm/Makefile [new file with mode: 0644]
tests/sys/vmm/utils.subr [new file with mode: 0644]
tests/sys/vmm/vmm_cred_jail.sh [new file with mode: 0644]