Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F158670895
D40626.id124880.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
901 B
Referenced Files
None
Subscribers
None
D40626.id124880.diff
View Options
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1430,9 +1430,12 @@
int
cr_canseejailproc(struct ucred *u1, struct ucred *u2)
{
- if (u1->cr_uid == 0)
+ if (see_jail_proc || /* Policy deactivated. */
+ u1->cr_prison == u2->cr_prison || /* Same jail. */
+ priv_check_cred(u1, PRIV_SEEJAILPROC) == 0) /* Privileged. */
return (0);
- return (!see_jail_proc && u1->cr_prison != u2->cr_prison ? ESRCH : 0);
+
+ return (ESRCH);
}
/*-
diff --git a/sys/sys/priv.h b/sys/sys/priv.h
--- a/sys/sys/priv.h
+++ b/sys/sys/priv.h
@@ -107,6 +107,7 @@
#define PRIV_CRED_SETRESGID 58 /* setresgid. */
#define PRIV_SEEOTHERGIDS 59 /* Exempt bsd.seeothergids. */
#define PRIV_SEEOTHERUIDS 60 /* Exempt bsd.seeotheruids. */
+#define PRIV_SEEJAILPROC 61 /* Exempt from bsd.see_jail_proc. */
/*
* Debugging privileges.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jun 5, 1:11 PM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33754505
Default Alt Text
D40626.id124880.diff (901 B)
Attached To
Mode
D40626: cr_canseejailproc(): New privilege, no direct check for UID 0
Attached
Detach File
Event Timeline
Log In to Comment