Loading...
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
10#include "policydb.h"
11
12/* Mapping for a single class */
13struct selinux_mapping {
14 u16 value; /* policy value for class */
15 unsigned int num_perms; /* number of permissions in class */
16 u32 perms[sizeof(u32) * 8]; /* policy values for permissions */
17};
18
19/* Map for all of the classes, with array size */
20struct selinux_map {
21 struct selinux_mapping *mapping; /* indexed by class */
22 u16 size; /* array size of mapping */
23};
24
25struct selinux_policy {
26 struct sidtab *sidtab;
27 struct policydb policydb;
28 struct selinux_map map;
29 u32 latest_granting;
30} __randomize_layout;
31
32struct convert_context_args {
33 struct selinux_state *state;
34 struct policydb *oldp;
35 struct policydb *newp;
36};
37
38void services_compute_xperms_drivers(struct extended_perms *xperms,
39 struct avtab_node *node);
40void services_compute_xperms_decision(struct extended_perms_decision *xpermd,
41 struct avtab_node *node);
42
43int services_convert_context(struct convert_context_args *args,
44 struct context *oldc, struct context *newc,
45 gfp_t gfp_flags);
46
47#endif /* _SS_SERVICES_H_ */
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
10#include "policydb.h"
11#include "sidtab.h"
12
13/* Mapping for a single class */
14struct 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 */
21struct selinux_map {
22 struct selinux_mapping *mapping; /* indexed by class */
23 u16 size; /* array size of mapping */
24};
25
26struct 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};
35
36void services_compute_xperms_drivers(struct extended_perms *xperms,
37 struct avtab_node *node);
38
39void services_compute_xperms_decision(struct extended_perms_decision *xpermd,
40 struct avtab_node *node);
41
42#endif /* _SS_SERVICES_H_ */