summaryrefslogtreecommitdiffstats
path: root/sys/compat/linprocfs
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-12-03 16:12:27 +0000
committerrwatson <rwatson@FreeBSD.org>2001-12-03 16:12:27 +0000
commitb5de44291122e0fc2bf68540749f66b3992d3ea2 (patch)
tree8f9d530e63e21e0286cad851a18efd4acdd6bd28 /sys/compat/linprocfs
parentc55fbd48a87bd450592bb317754a6bf3961674ff (diff)
downloadFreeBSD-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/compat/linprocfs')
-rw-r--r--sys/compat/linprocfs/linprocfs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index c64bf11..a23e561 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -90,6 +90,7 @@ extern int ncpus;
#include <machine/md_var.h>
#endif /* __i386__ */
+#include <machine/../linux/linux.h>
#include <compat/linux/linux_ioctl.h>
#include <compat/linux/linux_mib.h>
#include <compat/linux/linux_util.h>
@@ -444,11 +445,15 @@ linprocfs_douptime(PFS_FILL_ARGS)
static int
linprocfs_doversion(PFS_FILL_ARGS)
{
+ char osname[LINUX_MAX_UTSNAME];
+ char osrelease[LINUX_MAX_UTSNAME];
+
+ linux_get_osname(td->td_proc, osname);
+ linux_get_osrelease(td->td_proc, osrelease);
+
sbuf_printf(sb,
"%s version %s (des@freebsd.org) (gcc version " __VERSION__ ")"
- " #4 Sun Dec 18 04:30:00 CET 1977\n",
- linux_get_osname(td->td_proc),
- linux_get_osrelease(td->td_proc));
+ " #4 Sun Dec 18 04:30:00 CET 1977\n", osname, osrelease);
return (0);
}
OpenPOWER on IntegriCloud