aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/mls.h
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/ss/mls.h')
-rw-r--r--security/selinux/ss/mls.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h
index fbb42f07dd7c..90c5e88987fa 100644
--- a/security/selinux/ss/mls.h
+++ b/security/selinux/ss/mls.h
@@ -17,6 +17,26 @@
17#include "context.h" 17#include "context.h"
18#include "policydb.h" 18#include "policydb.h"
19 19
20/*
21 * Copies the MLS range from `src' into `dst'.
22 */
23static inline int mls_copy_context(struct context *dst,
24 struct context *src)
25{
26 int l, rc = 0;
27
28 /* Copy the MLS range from the source context */
29 for (l = 0; l < 2; l++) {
30 dst->range.level[l].sens = src->range.level[l].sens;
31 rc = ebitmap_cpy(&dst->range.level[l].cat,
32 &src->range.level[l].cat);
33 if (rc)
34 break;
35 }
36
37 return rc;
38}
39
20int mls_compute_context_len(struct context *context); 40int mls_compute_context_len(struct context *context);
21void mls_sid_to_context(struct context *context, char **scontext); 41void mls_sid_to_context(struct context *context, char **scontext);
22int mls_context_isvalid(struct policydb *p, struct context *c); 42int mls_context_isvalid(struct policydb *p, struct context *c);