diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-12-03 16:12:27 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-12-03 16:12:27 +0000 |
commit | b5de44291122e0fc2bf68540749f66b3992d3ea2 (patch) | |
tree | 8f9d530e63e21e0286cad851a18efd4acdd6bd28 /sys/fs | |
parent | c55fbd48a87bd450592bb317754a6bf3961674ff (diff) | |
download | FreeBSD-src-b5de44291122e0fc2bf68540749f66b3992d3ea2.zip FreeBSD-src-b5de44291122e0fc2bf68540749f66b3992d3ea2.tar.gz |
o Introduce pr_mtx into struct prison, providing protection for the
mutable contents of struct prison (hostname, securelevel, refcount,
pr_linux, ...)
o Generally introduce mtx_lock()/mtx_unlock() calls throughout kern/
so as to enforce these protections, in particular, in kern_mib.c
protection sysctl access to the hostname and securelevel, as well as
kern_prot.c access to the securelevel for access control purposes.
o Rewrite linux emulator abstractions for accessing per-jail linux
mib entries (osname, osrelease, osversion) so that they don't return
a pointer to the text in the struct linux_prison, rather, a copy
to an array passed into the calls. Likewise, update linprocfs to
use these primitives.
o Update in_pcb.c to always use prison_getip() rather than directly
accessing struct prison.
Reviewed by: jhb
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/procfs/procfs_status.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c index ee5cc7b..6dd34c7 100644 --- a/sys/fs/procfs/procfs_status.c +++ b/sys/fs/procfs/procfs_status.c @@ -43,10 +43,10 @@ #include <sys/param.h> #include <sys/systm.h> #include <sys/exec.h> -#include <sys/jail.h> #include <sys/lock.h> -#include <sys/malloc.h> #include <sys/mutex.h> +#include <sys/jail.h> +#include <sys/malloc.h> #include <sys/proc.h> #include <sys/resourcevar.h> #include <sys/tty.h> @@ -178,11 +178,14 @@ procfs_dostatus(curp, p, pfs, uio) DOCHECK(); } - if (jailed(p->p_ucred)) + if (jailed(p->p_ucred)) { + mtx_lock(&p->p_ucred->cr_prison->pr_mtx); ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " %s", p->p_ucred->cr_prison->pr_host); - else + mtx_unlock(&p->p_ucred->cr_prison->pr_mtx); + } else { ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, " -"); + } DOCHECK(); ps += snprintf(ps, psbuf + sizeof(psbuf) - ps, "\n"); DOCHECK(); |