Page MenuHomeFreeBSD

racct: Add racct_add_cred_checked
Needs ReviewPublic

Authored by cyril_freebsdfoundation.org on Jun 21 2021, 8:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 5:10 PM
Unknown Object (File)
Tue, Nov 26, 5:10 PM
Unknown Object (File)
Tue, Nov 26, 4:46 PM
Unknown Object (File)
Oct 12 2024, 11:25 AM
Unknown Object (File)
Oct 6 2024, 5:54 PM
Unknown Object (File)
Oct 3 2024, 6:23 PM
Unknown Object (File)
Oct 3 2024, 10:36 AM
Unknown Object (File)
Oct 3 2024, 9:35 AM
Subscribers
None

Details

Reviewers
markj
Summary

racct_add_cred_checked is a version of racct_add_cred that adheres to rctl limits.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

sys/kern/kern_racct.c
647

There is some inconsistency in that racct_add_cred_locked() does not enforce limits, while racct_add_locked() does. I can see why you did it this way though.

sys/kern/kern_rctl.c
547

Style: the opening brace should be on its own line.

607

Can we factor the individual handlers out? I see that for process-based rctl we have an extra check of p_state, but we can make that conditional, e.g., by specifying a NULL process pointer when enforcing limits by cred.

Adds a new checked version of racct_add_cred instead of adding the checks into racct_add_cred. Also factors the individual handlers out of rctl_enforce so that they can be re-used for rctl_enforce_cred.

cyril_freebsdfoundation.org retitled this revision from racct: Make racct_add_cred adhere to rctl limits to racct: Add racct_add_cred_checked.
cyril_freebsdfoundation.org edited the summary of this revision. (Show Details)