Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Implementation of the security services. |
| 4 | * |
Stephen Smalley | 7efbb60 | 2017-08-17 13:32:36 -0400 | [diff] [blame] | 5 | * Author : Stephen Smalley, <sds@tycho.nsa.gov> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
| 7 | #ifndef _SS_SERVICES_H_ |
| 8 | #define _SS_SERVICES_H_ |
| 9 | |
| 10 | #include "policydb.h" |
| 11 | #include "sidtab.h" |
| 12 | |
Stephen Smalley | aa8e712 | 2018-03-01 18:48:02 -0500 | [diff] [blame] | 13 | /* Mapping for a single class */ |
| 14 | struct selinux_mapping { |
| 15 | u16 value; /* policy value for class */ |
| 16 | unsigned int num_perms; /* number of permissions in class */ |
| 17 | u32 perms[sizeof(u32) * 8]; /* policy values for permissions */ |
| 18 | }; |
| 19 | |
| 20 | /* Map for all of the classes, with array size */ |
| 21 | struct selinux_map { |
| 22 | struct selinux_mapping *mapping; /* indexed by class */ |
| 23 | u16 size; /* array size of mapping */ |
| 24 | }; |
| 25 | |
| 26 | struct selinux_ss { |
| 27 | struct sidtab sidtab; |
| 28 | struct policydb policydb; |
| 29 | rwlock_t policy_rwlock; |
| 30 | u32 latest_granting; |
| 31 | struct selinux_map map; |
| 32 | struct page *status_page; |
| 33 | struct mutex status_lock; |
| 34 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Jeff Vander Stoep | fa1aa14 | 2015-07-10 17:19:56 -0400 | [diff] [blame] | 36 | void services_compute_xperms_drivers(struct extended_perms *xperms, |
| 37 | struct avtab_node *node); |
| 38 | |
| 39 | void services_compute_xperms_decision(struct extended_perms_decision *xpermd, |
| 40 | struct avtab_node *node); |
| 41 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | #endif /* _SS_SERVICES_H_ */ |