avc_compute_create - Linux


avc_compute_create is a versatile tool used for creating access vector cache (AVC) entries. AVCs define the permissions and constraints associated with specific tasks or operations within the Linux Security Module (LSM). By creating AVC entries, system administrators can enforce granular access controls to protect sensitive data and system resources. This command is particularly useful for customizing security policies or addressing specific security requirements.


avc_compute_create [options] [av_expression]


| Option | Description | Default Value |
| -A | Perform action (enforce or grant) | enforce |
| -E | Evaluate the expression without modifying the AVC | false |
| -P | Print policy entry instead of creating | false |
| -l label | Label for the source (subject) entity | current executing process |
| -t type | Type for the target (object) entity | current executing process |
| -q | Quiet mode (suppress output) | false |


Enforce access permissions:

avc_compute_create -A enforce allow -l foo_user -t foo_file read

Evaluate an expression without modifying AVC:

avc_compute_create -E allow -l foo_user -t foo_file write

Print policy entry instead of creating:

avc_compute_create -P -l foo_user -t foo_file write

Common Issues

  • Incorrect syntax: Ensure the command syntax is correct, including all required flags and arguments.
  • Permission denied: Verify that the user running the command has sufficient privileges to create AVC entries.
  • Invalid entity labels: Confirm that the provided labels for source and target entities are valid and exist within the system.
  • Duplicate AVC entries: Be cautious not to create duplicate AVC entries, as this can lead to unpredictable behavior or permission conflicts.


avc_compute_create can be integrated with other tools for advanced security management tasks:

  • Use ausearch to analyze security events and identify potential policy violations.
  • Combine with audit2allow to generate AVC rules based on audit logs.
  • Integrate with policy editors like SEPOL or MCSC to create and modify security policies.

Related Commands

  • semanage avc_add: Add AVC entries using a different interface.
  • semanage avc_compute: Compute the current AVC state.
  • ausearch: Search for audit events.
  • audit2allow: Generate AVC rules from audit logs.