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
F102583144: D40629.id124665.diff
Thu, Nov 14, 9:13 AM
Unknown Object (File)
Sun, Nov 10, 8:34 PM
Unknown Object (File)
Fri, Nov 8, 2:48 PM
Unknown Object (File)
Thu, Nov 7, 9:56 AM
Unknown Object (File)
Wed, Nov 6, 10:43 AM
Unknown Object (File)
Tue, Nov 5, 10:16 AM
Unknown Object (File)
Tue, Oct 29, 4:54 AM
Unknown Object (File)
Sun, Oct 27, 4:38 PM
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 52676
Build 49567: arc lint + arc unit

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.