1.\" 2.\" SPDX-License-Identifier: BSD-2-Clause 3.\" 4.\" Copyright (c) 2023 Olivier Certner <olce.freebsd@certner.fr> 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd August 18, 2023 27.Dt CR_CANSEEJAILPROC 9 28.Os 29.Sh NAME 30.Nm cr_canseejailproc 31.Nd determine if subjects may see entities in sub-jails 32.Sh SYNOPSIS 33.Ft int 34.Fn cr_canseejailproc "struct ucred *u1" "struct ucred *u2" 35.Sh DESCRIPTION 36.Bf -emphasis 37This function is internal. 38Its functionality is integrated into the function 39.Xr cr_bsd_visible 9 , 40which should be called instead. 41.Ef 42.Pp 43This function checks if a subject associated to credentials 44.Fa u1 45is denied seeing a subject or object associated to credentials 46.Fa u2 47by a policy that requires both credentials to be associated to the same jail. 48This is a restriction to the baseline jail policy that a subject can see 49subjects or objects in its own jail or any sub-jail of it. 50.Pp 51This policy is active if and only if the 52.Xr sysctl 8 53variable 54.Va security.bsd.see_jail_proc 55is set to zero. 56.Pp 57As usual, the superuser (effective user ID 0) is exempt from this policy 58provided that the 59.Xr sysctl 8 60variable 61.Va security.bsd.suser_enabled 62is non-zero and no active MAC policy explicitly denies the exemption 63.Po 64see 65.Xr priv_check_cred 9 66.Pc . 67.Sh RETURN VALUES 68The 69.Fn cr_canseejailproc 70function returns 0 if the policy is disabled, both credentials are associated to 71the same jail, or if 72.Fa u1 73has privilege exempting it from the policy. 74Otherwise, it returns 75.Er ESRCH . 76.Sh SEE ALSO 77.Xr cr_bsd_visible 9 , 78.Xr priv_check_cred 9 79.Sh AUTHORS 80This manual page was written by 81.An Olivier Certner Aq Mt olce.freebsd@certner.fr . 82