services.h 998 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Implementation of the security services.
  4. *
  5. * Author : Stephen Smalley, <[email protected]>
  6. */
  7. #ifndef _SS_SERVICES_H_
  8. #define _SS_SERVICES_H_
  9. #include "policydb.h"
  10. /* Mapping for a single class */
  11. struct selinux_mapping {
  12. u16 value; /* policy value for class */
  13. unsigned int num_perms; /* number of permissions in class */
  14. u32 perms[sizeof(u32) * 8]; /* policy values for permissions */
  15. };
  16. /* Map for all of the classes, with array size */
  17. struct selinux_map {
  18. struct selinux_mapping *mapping; /* indexed by class */
  19. u16 size; /* array size of mapping */
  20. };
  21. struct selinux_policy {
  22. struct sidtab *sidtab;
  23. struct policydb policydb;
  24. struct selinux_map map;
  25. u32 latest_granting;
  26. } __randomize_layout;
  27. void services_compute_xperms_drivers(struct extended_perms *xperms,
  28. struct avtab_node *node);
  29. void services_compute_xperms_decision(struct extended_perms_decision *xpermd,
  30. struct avtab_node *node);
  31. #endif /* _SS_SERVICES_H_ */