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)
Sun, Mar 31, 1:50 PM
Unknown Object (File)
Thu, Mar 28, 9:00 PM
Unknown Object (File)
Mar 10 2024, 6:24 AM
Unknown Object (File)
Jan 22 2024, 7:41 PM
Unknown Object (File)
Dec 12 2023, 7:08 PM
Unknown Object (File)
Nov 25 2023, 2:56 AM
Unknown Object (File)
Nov 21 2023, 4:14 AM
Unknown Object (File)
Nov 21 2023, 3:40 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
645

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)