aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2001-10-09 21:40:30 +0000
committerRobert Watson <rwatson@FreeBSD.org>2001-10-09 21:40:30 +0000
commit8a7d8cc675b1af282ea9d2d5fa1cc2debe9d307b (patch)
tree27edf05b443ffb7ba251232e556388f4f7b779ec /sys/kern/uipc_usrreq.c
parentbc1ce487e97ce2a692073d5591a3027448d6423f (diff)
downloadsrc-8a7d8cc675b1af282ea9d2d5fa1cc2debe9d307b.tar.gz
src-8a7d8cc675b1af282ea9d2d5fa1cc2debe9d307b.zip
- Combine kern.ps_showallprocs and kern.ipc.showallsockets into
a single kern.security.seeotheruids_permitted, describes as: "Unprivileged processes may see subjects/objects with different real uid" NOTE: kern.ps_showallprocs exists in -STABLE, and therefore there is an API change. kern.ipc.showallsockets does not. - Check kern.security.seeotheruids_permitted in cr_cansee(). - Replace visibility calls to socheckuid() with cr_cansee() (retain the change to socheckuid() in ipfw, where it is used for rule-matching). - Remove prison_unpcb() and make use of cr_cansee() against the UNIX domain socket credential instead of comparing root vnodes for the UDS and the process. This allows multiple jails to share the same chroot() and not see each others UNIX domain sockets. - Remove unused socheckproc(). Now that cr_cansee() is used universally for socket visibility, a variety of policies are more consistently enforced, including uid-based restrictions and jail-based restrictions. This also better-supports the introduction of additional MAC models. Reviewed by: ps, billf Obtained from: TrustedBSD Project
Notes
Notes: svn path=/head/; revision=84736
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 747dbe20812b..12af404d8fdd 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -803,16 +803,6 @@ unp_abort(unp)
#endif
static int
-prison_unpcb(struct proc *p, struct unpcb *unp)
-{
- if (!jailed(p->p_ucred))
- return (0);
- if (p->p_fd->fd_rdir == unp->unp_rvnode)
- return (0);
- return (1);
-}
-
-static int
unp_pcblist(SYSCTL_HANDLER_ARGS)
{
int error, i, n;
@@ -859,9 +849,9 @@ unp_pcblist(SYSCTL_HANDLER_ARGS)
for (unp = LIST_FIRST(head), i = 0; unp && i < n;
unp = LIST_NEXT(unp, unp_link)) {
- if (unp->unp_gencnt <= gencnt && !prison_unpcb(req->p, unp)) {
- if (!showallsockets && socheckproc(unp->unp_socket,
- curthread->td_proc))
+ if (unp->unp_gencnt <= gencnt) {
+ if (cr_cansee(req->p->p_ucred,
+ unp->unp_socket->so_cred))
continue;
unp_list[i++] = unp;
}