services.h 1.0 KB

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