CR_BSD_VISIBLE(9)
π CR_BSD_VISIBLE(9) β the kernel dev manual page, bestie edition π
okay so real talk: this is a section 9 page from the Kernel Developer's Manual, and it's all about cr_bsd_visible β the little function that decides whether someone is even allowed to see you π. It's giving bouncer-at-the-club energy, fr fr.
β¨ NAME β¨
cr_bsd_visible β figue out if subjects may see entities according to the BSD security policies π΅οΈββοΈ
β¨ SYNOPSIS β¨
#include <sys/proc.h>
int
cr_bsd_visible(struct ucred *u1, struct ucred *u2);
β¨ DESCRIPTION β¨
So here's the tea π΅: this function checks whether a subject holding credentials u1 is denied seeing an object or another subject that's associated with credentials u2. It runs that vibe check against these policies and their matching sysctl(8) knobs:
security.bsd.seeotheruidsβ if this is set to0, subjects literally cannot see other subjects or objects unless they're associated with the same real user ID. The internal function doing the work here iscr_canseeotheruids(9).security.bsd.seeothergidsβ if this is set to0, subjects cannot see other subjects or objects unless they're both a member of at least one common group. The internal function responsible iscr_canseeothergids(9).security.bsd.see_jail_procβ if this is set to0, subjects cannot see other subjects or objects that aren't associated with the same jail as them. The internal function behind it iscr_canseejailproc(9).
And as usual, the superuser (effective user ID 0) is exempt from any of these policies π β provided the sysctl(8) variable security.bsd.suser_enabled is non-zero and no active MAC policy explicitly denies the exemption (peep priv_check_cred(9) for that).
This function is intended to be used as a helper to implement cr_cansee(9) and similar functions. It's the supporting character that absolutely ate π
.
β¨ RETURN VALUES β¨
It returns zero if a subject with credentials u1 may see a subject or object with credentials u2 according to the active above-mentioned policies. Otherwise? ESRCH. That's it, that's the answer π
β¨ ERRORS β¨
[ESRCH]β Credentialsu1andu2do not have the same real user ID.[ESRCH]β Credentialsu1andu2are not members of any common group (as determined byrealgroupmember(9)).[ESRCH]β Credentialsu1andu2are not in the same jail.
β¨ SEE ALSO β¨
cr_cansee(9), cr_canseejailproc(9), cr_canseeothergids(9), cr_canseeotheruids(9), priv_check_cred(9)
β¨ AUTHORS β¨
This function and its manual page were written by Olivier Certner <olce.freebsd@certner.fr>. iconic of him honestly π«Ά
and that's the whole page, bestie β source is Debian, dated August 18, 2023, CR_BSD_VISIBLE(9). go forth and see (or don't see) other subjects πβ¨π¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2023 Olivier Certner <olce.freebsd@certner.fr>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms