--- a/sys/dev/vmm/vmm_dev.c +++ b/sys/dev/vmm/vmm_dev.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -74,14 +75,11 @@ static void devmem_destroy(void *arg); static int devmem_create_cdev(struct vmmdev_softc *sc, int id, char *devmem); +/* VMM_PRIV_CHECK_FIX_APPLIED */ static int -vmm_priv_check(struct ucred *ucred) +vmm_priv_check(struct thread *td) { - if (jailed(ucred) && - !(ucred->cr_prison->pr_allow & pr_allow_flag)) - return (EPERM); - - return (0); + return (priv_check(td, PRIV_DRIVER)); } static int @@ -334,7 +332,7 @@ * A jail without vmm access shouldn't be able to access vmm device * files at all, but check here just to be thorough. */ - error = vmm_priv_check(td->td_ucred); + error = vmm_priv_check(td); if (error != 0) return (error); @@ -813,7 +811,7 @@ char *buf; int error, buflen; - error = vmm_priv_check(req->td->td_ucred); + error = vmm_priv_check(req->td); if (error) return (error); @@ -902,7 +900,7 @@ char *buf; int error, buflen; - error = vmm_priv_check(req->td->td_ucred); + error = vmm_priv_check(req->td); if (error != 0) return (error); @@ -925,7 +923,7 @@ { int error; - error = vmm_priv_check(td->td_ucred); + error = vmm_priv_check(td); if (error != 0) return (error);