Page MenuHomeFreeBSD

Make cr_bsd_visible()'s sub-functions internal
ClosedPublic

Authored by olce on Jun 20 2023, 1:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 6:51 AM
Unknown Object (File)
Thu, May 9, 7:34 PM
Unknown Object (File)
Sat, May 4, 5:13 PM
Unknown Object (File)
Mar 9 2024, 1:56 PM
Unknown Object (File)
Jan 27 2024, 6:25 AM
Unknown Object (File)
Jan 19 2024, 3:47 AM
Unknown Object (File)
Dec 30 2023, 12:14 PM
Unknown Object (File)
Dec 20 2023, 3:51 AM
Subscribers

Details

Summary

cr_canseeotheruids(), cr_canseeothergids() and cr_canseejailproc() should not be
used directly now. cr_bsd_visible() has to be called instead.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olce requested review of this revision.Jun 20 2023, 1:44 PM
zlei requested changes to this revision.Jul 2 2023, 7:18 AM
zlei added a subscriber: zlei.

These functions are exported, I think they should be kept as is to keep KPI compatibility.

This revision now requires changes to proceed.Jul 2 2023, 7:18 AM

We can change KPI across major versions at least, can't we?

This change has several goals. The first is to prevent consumers from using any of these individual functions, which are called by cr_bsd_visibility() itself. This helps avoid bugs where some callers forget to check if a particular policy authorizes accesses, which is exactly what happened with see_jail_proc. A second goal is that, more conceptually, visibility policies can be seen as a block that should be applied at once. If, in the future, some policy is added, it will just have to in cr_bsd_visibility() (no need of sprinkling calls all around).

olce requested review of this revision.Jul 10 2023, 12:45 PM
olce retitled this revision from Make cr_bsd_visibility()'s sub-functions internal to Make cr_bsd_visible()'s sub-functions internal.
olce edited the summary of this revision. (Show Details)

Rename cr_bsd_visibility() to cr_bsd_visible().

Update context lines after update of D40626.

Re-validate, since no actual changes.

This revision is now accepted and ready to land.Aug 2 2023, 10:37 AM
This revision was automatically updated to reflect the committed changes.