aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/selinux.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/selinux.h')
-rw-r--r--include/linux/selinux.h29
1 files changed, 7 insertions, 22 deletions
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index aad4e390d6a5..d1b7ca6c1c57 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -46,7 +46,7 @@ void selinux_audit_rule_free(struct selinux_audit_rule *rule);
46 46
47/** 47/**
48 * selinux_audit_rule_match - determine if a context ID matches a rule. 48 * selinux_audit_rule_match - determine if a context ID matches a rule.
49 * @ctxid: the context ID to check 49 * @sid: the context ID to check
50 * @field: the field this rule refers to 50 * @field: the field this rule refers to
51 * @op: the operater the rule uses 51 * @op: the operater the rule uses
52 * @rule: pointer to the audit rule to check against 52 * @rule: pointer to the audit rule to check against
@@ -55,7 +55,7 @@ void selinux_audit_rule_free(struct selinux_audit_rule *rule);
55 * Returns 1 if the context id matches the rule, 0 if it does not, and 55 * Returns 1 if the context id matches the rule, 0 if it does not, and
56 * -errno on failure. 56 * -errno on failure.
57 */ 57 */
58int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, 58int selinux_audit_rule_match(u32 sid, u32 field, u32 op,
59 struct selinux_audit_rule *rule, 59 struct selinux_audit_rule *rule,
60 struct audit_context *actx); 60 struct audit_context *actx);
61 61
@@ -70,18 +70,8 @@ int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
70void selinux_audit_set_callback(int (*callback)(void)); 70void selinux_audit_set_callback(int (*callback)(void));
71 71
72/** 72/**
73 * selinux_task_ctxid - determine a context ID for a process. 73 * selinux_sid_to_string - map a security context ID to a string
74 * @tsk: the task object 74 * @sid: security context ID to be converted.
75 * @ctxid: ID value returned via this
76 *
77 * On return, ctxid will contain an ID for the context. This value
78 * should only be used opaquely.
79 */
80void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
81
82/**
83 * selinux_ctxid_to_string - map a security context ID to a string
84 * @ctxid: security context ID to be converted.
85 * @ctx: address of context string to be returned 75 * @ctx: address of context string to be returned
86 * @ctxlen: length of returned context string. 76 * @ctxlen: length of returned context string.
87 * 77 *
@@ -89,7 +79,7 @@ void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
89 * string will be allocated internally, and the caller must call 79 * string will be allocated internally, and the caller must call
90 * kfree() on it after use. 80 * kfree() on it after use.
91 */ 81 */
92int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen); 82int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen);
93 83
94/** 84/**
95 * selinux_get_inode_sid - get the inode's security context ID 85 * selinux_get_inode_sid - get the inode's security context ID
@@ -154,7 +144,7 @@ static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
154 return; 144 return;
155} 145}
156 146
157static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op, 147static inline int selinux_audit_rule_match(u32 sid, u32 field, u32 op,
158 struct selinux_audit_rule *rule, 148 struct selinux_audit_rule *rule,
159 struct audit_context *actx) 149 struct audit_context *actx)
160{ 150{
@@ -166,12 +156,7 @@ static inline void selinux_audit_set_callback(int (*callback)(void))
166 return; 156 return;
167} 157}
168 158
169static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid) 159static inline int selinux_sid_to_string(u32 sid, char **ctx, u32 *ctxlen)
170{
171 *ctxid = 0;
172}
173
174static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
175{ 160{
176 *ctx = NULL; 161 *ctx = NULL;
177 *ctxlen = 0; 162 *ctxlen = 0;