Page MenuHomeFreeBSD

racct: Add racct_add_cred_checked
Needs ReviewPublic

Authored by cyril_freebsdfoundation.org on Jun 21 2021, 8:51 PM.

Details

Reviewers
markj
Summary

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

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

sys/kern/kern_racct.c
646

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
546

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

606

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)