Lines Matching defs:scontext

79 				    char **scontext,
85 char **scontext,
89 struct context *scontext,
259 * only. For these rules, scontext is the context before the transition,
265 struct context *scontext,
299 val1 = scontext->user;
303 val1 = scontext->type;
307 val1 = scontext->role;
331 l1 = &(scontext->range.level[0]);
335 l1 = &(scontext->range.level[0]);
339 l1 = &(scontext->range.level[1]);
343 l1 = &(scontext->range.level[1]);
347 l1 = &(scontext->range.level[0]);
348 l2 = &(scontext->range.level[1]);
396 c = scontext;
456 struct context *scontext,
490 /* get scontext/tcontext in text form */
491 if (context_struct_to_string(policydb, scontext,
506 "scontext=%s tcontext=%s tclass=%s perms=",
523 /* release scontext/tcontext */
533 struct context *scontext,
545 source = policydb->type_val_to_struct[scontext->type - 1];
556 memcpy(&lo_scontext, scontext, sizeof(lo_scontext));
580 security_dump_masked_av(policydb, scontext, tcontext,
612 struct context *scontext,
649 sattr = &policydb->type_attr_map_array[scontext->type - 1];
683 !constraint_expr_eval(policydb, scontext, tcontext, NULL,
697 scontext->role != tcontext->role) {
699 if (scontext->role == ra->role &&
712 type_attribute_bounds_av(policydb, scontext, tcontext,
1010 struct context *scontext, *tcontext;
1031 scontext = sidtab_search(sidtab, ssid);
1032 if (!scontext) {
1060 sattr = &policydb->type_attr_map_array[scontext->type - 1];
1105 struct context *scontext = NULL, *tcontext = NULL;
1117 scontext = sidtab_search(sidtab, ssid);
1118 if (!scontext) {
1125 if (ebitmap_get_bit(&policydb->permissive_map, scontext->type))
1141 context_struct_compute_av(policydb, scontext, tcontext, tclass, avd,
1161 struct context *scontext = NULL, *tcontext = NULL;
1172 scontext = sidtab_search(sidtab, ssid);
1173 if (!scontext) {
1180 if (ebitmap_get_bit(&policydb->permissive_map, scontext->type))
1196 context_struct_compute_av(policydb, scontext, tcontext, tclass, avd,
1209 * allocated string of the correct size. Set `*scontext'
1215 char **scontext, u32 *scontext_len)
1219 if (scontext)
1220 *scontext = NULL;
1225 if (scontext) {
1226 *scontext = kstrdup(context->str, GFP_ATOMIC);
1227 if (!(*scontext))
1239 if (!scontext)
1246 *scontext = scontextp;
1266 char **scontext, u32 *scontext_len)
1268 int rc = sidtab_sid2str_get(sidtab, entry, scontext, scontext_len);
1273 rc = context_struct_to_string(p, &entry->context, scontext,
1275 if (!rc && scontext)
1276 sidtab_sid2str_put(sidtab, entry, *scontext, *scontext_len);
1308 static int security_sid_to_context_core(u32 sid, char **scontext,
1318 if (scontext)
1319 *scontext = NULL;
1330 if (!scontext)
1335 *scontext = scontextp;
1360 rc = sidtab_entry_to_string(policydb, sidtab, entry, scontext,
1372 * @scontext: security context
1376 * into a dynamically allocated string of the correct size. Set @scontext
1379 int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len)
1381 return security_sid_to_context_core(sid, scontext,
1386 char **scontext, u32 *scontext_len)
1388 return security_sid_to_context_core(sid, scontext,
1396 * @scontext: security context
1401 * context is invalid in the current policy. Set @scontext to point to
1406 char **scontext, u32 *scontext_len)
1408 return security_sid_to_context_core(sid, scontext,
1413 * Caveat: Mutates scontext.
1417 char *scontext,
1432 scontextp = scontext;
1493 static int security_context_to_sid_core(const char *scontext, u32 scontext_len,
1509 scontext2 = kmemdup_nul(scontext, scontext_len, gfp_flags);
1570 * @scontext: security context
1576 * has the string representation specified by @scontext.
1580 int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid,
1583 return security_context_to_sid_core(scontext, scontext_len,
1587 int security_context_str_to_sid(const char *scontext, u32 *sid, gfp_t gfp)
1589 return security_context_to_sid(scontext, strlen(scontext),
1597 * @scontext: security context
1604 * has the string representation specified by @scontext.
1612 int security_context_to_sid_default(const char *scontext, u32 scontext_len,
1615 return security_context_to_sid_core(scontext, scontext_len,
1619 int security_context_to_sid_force(const char *scontext, u32 scontext_len,
1622 return security_context_to_sid_core(scontext, scontext_len,
1652 audit_log_format(ab, " scontext=%s tcontext=%s tclass=%s",
1706 struct context *scontext, *tcontext, newcontext;
1761 scontext = &sentry->context;
1776 newcontext.user = scontext->user;
1787 newcontext.role = scontext->role;
1792 newcontext.role = scontext->role;
1799 newcontext.type = scontext->type;
1805 newcontext.type = scontext->type;
1813 avkey.source_type = scontext->type;
1837 filename_compute_type(policydb, &newcontext, scontext->type,
1845 .role = scontext->role,
1857 rc = mls_compute_sid(policydb, scontext, tcontext, tclass, specified,