services.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Implementation of the security services.
  4. *
  5. * Author : Stephen Smalley, <stephen.smalley.work@gmail.com>
  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. u16 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. struct convert_context_args {
  28. struct policydb *oldp;
  29. struct policydb *newp;
  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. int services_convert_context(struct convert_context_args *args,
  36. struct context *oldc, struct context *newc,
  37. gfp_t gfp_flags);
  38. #endif /* _SS_SERVICES_H_ */