Lines Matching full:sid
793 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_validatetrans()
801 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_validatetrans()
809 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_validatetrans()
882 pr_err("SELinux: %s: unrecognized SID %u\n", in security_bounded_transition()
890 pr_err("SELinux: %s: unrecognized SID %u\n", in security_bounded_transition()
1061 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_xperms_decision()
1068 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_xperms_decision()
1121 * SID pair (@ssid, @tsid) for the permissions in @tclass.
1147 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_av()
1158 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_av()
1202 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_av_user()
1213 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_av_user()
1329 const char *security_get_initial_sid_context(u32 sid) in security_get_initial_sid_context() argument
1331 if (unlikely(sid > SECINITSID_NUM)) in security_get_initial_sid_context()
1333 return initial_sid_to_string[sid]; in security_get_initial_sid_context()
1336 static int security_sid_to_context_core(u32 sid, char **scontext, in security_sid_to_context_core() argument
1351 if (sid <= SECINITSID_NUM) { in security_sid_to_context_core()
1362 if (sid == SECINITSID_INIT) in security_sid_to_context_core()
1363 sid = SECINITSID_KERNEL; in security_sid_to_context_core()
1365 s = initial_sid_to_string[sid]; in security_sid_to_context_core()
1378 "load_policy on unknown SID %d\n", __func__, sid); in security_sid_to_context_core()
1387 entry = sidtab_search_entry_force(sidtab, sid); in security_sid_to_context_core()
1389 entry = sidtab_search_entry(sidtab, sid); in security_sid_to_context_core()
1391 pr_err("SELinux: %s: unrecognized SID %d\n", in security_sid_to_context_core()
1392 __func__, sid); in security_sid_to_context_core()
1409 * security_sid_to_context - Obtain a context for a given SID.
1410 * @sid: security identifier, SID
1414 * Write the string representation of the context associated with @sid
1418 int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len) in security_sid_to_context() argument
1420 return security_sid_to_context_core(sid, scontext, in security_sid_to_context()
1424 int security_sid_to_context_force(u32 sid, in security_sid_to_context_force() argument
1427 return security_sid_to_context_core(sid, scontext, in security_sid_to_context_force()
1432 * security_sid_to_context_inval - Obtain a context for a given SID if it
1434 * @sid: security identifier, SID
1438 * Write the string representation of the context associated with @sid
1444 int security_sid_to_context_inval(u32 sid, in security_sid_to_context_inval() argument
1447 return security_sid_to_context_core(sid, scontext, in security_sid_to_context_inval()
1533 u32 *sid, u32 def_sid, gfp_t gfp_flags, in security_context_to_sid_core() argument
1559 *sid = i; in security_context_to_sid_core()
1563 *sid = SECINITSID_KERNEL; in security_context_to_sid_core()
1566 *sid = SECSID_NULL; in security_context_to_sid_core()
1588 rc = sidtab_context_to_sid(sidtab, &context, sid); in security_context_to_sid_core()
1608 * security_context_to_sid - Obtain a SID for a given security context.
1611 * @sid: security identifier, SID
1614 * Obtains a SID associated with the security context that
1619 int security_context_to_sid(const char *scontext, u32 scontext_len, u32 *sid, in security_context_to_sid() argument
1623 sid, SECSID_NULL, gfp, 0); in security_context_to_sid()
1626 int security_context_str_to_sid(const char *scontext, u32 *sid, gfp_t gfp) in security_context_str_to_sid() argument
1629 sid, gfp); in security_context_str_to_sid()
1633 * security_context_to_sid_default - Obtain a SID for a given security context,
1638 * @sid: security identifier, SID
1639 * @def_sid: default SID to assign on error
1642 * Obtains a SID associated with the security context that
1644 * The default SID is passed to the MLS layer to be used to allow
1652 u32 *sid, u32 def_sid, gfp_t gfp_flags) in security_context_to_sid_default() argument
1655 sid, def_sid, gfp_flags, 1); in security_context_to_sid_default()
1659 u32 *sid) in security_context_to_sid_force() argument
1662 sid, SECSID_NULL, GFP_KERNEL, 1); in security_context_to_sid_force()
1787 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_sid()
1794 pr_err("SELinux: %s: unrecognized SID %d\n", in security_compute_sid()
1911 /* Obtain the sid for the context. */ in security_compute_sid()
1926 * security_transition_sid - Compute the SID for a new subject/object.
1933 * Compute a SID to use for labeling a new subject or object in the
1934 * class @tclass based on a SID pair (@ssid, @tsid).
1936 * if insufficient memory is available, or %0 if the new SID was
1956 * security_member_sid - Compute the SID for member selection.
1962 * Compute a SID to use when selecting a member of a polyinstantiated
1963 * object of class @tclass based on a SID pair (@ssid, @tsid).
1965 * if insufficient memory is available, or %0 if the SID was
1979 * security_change_sid - Compute the SID for object relabeling.
1985 * Compute a SID to use for relabeling an object of class @tclass
1986 * based on a SID pair (@ssid, @tsid).
1988 * if insufficient memory is available, or %0 if the SID was
2111 while (oc && oc->sid[0] != SECINITSID_UNLABELED) in services_convert_context()
2276 * validate it and convert the SID table as necessary.
2334 * in the new SID table. in security_load_policy()
2352 " representation of contexts in the new SID" in security_load_policy()
2378 * ocontext_to_sid - Helper to safely get sid for an ocontext
2379 * @sidtab: SID table
2382 * @out_sid: pointer to the resulting SID value
2384 * For all ocontexts except OCON_ISID the SID fields are populated
2385 * on-demand when needed. Since updating the SID value is an SMP-sensitive
2395 u32 sid; in ocontext_to_sid() local
2398 sid = smp_load_acquire(&c->sid[index]); in ocontext_to_sid()
2399 if (!sid) { in ocontext_to_sid()
2400 rc = sidtab_context_to_sid(sidtab, &c->context[index], &sid); in ocontext_to_sid()
2406 * when they see the SID. in ocontext_to_sid()
2408 smp_store_release(&c->sid[index], sid); in ocontext_to_sid()
2410 *out_sid = sid; in ocontext_to_sid()
2415 * security_port_sid - Obtain the SID for a port.
2467 * security_ib_pkey_sid - Obtain the SID for a pkey.
2519 * security_ib_endport_sid - Obtain the SID for a subnet management interface.
2572 * security_netif_sid - Obtain the SID for a network interface.
2574 * @if_sid: interface SID
2639 * security_node_sid - Obtain the SID for a node (host).
2727 * @fromsid: starting SID
2748 u32 *mysids = NULL, *mysids2, sid; in security_get_user_sids() local
2796 rc = sidtab_context_to_sid(sidtab, &usercon, &sid); in security_get_user_sids()
2804 mysids[mynel++] = sid; in security_get_user_sids()
2814 mysids[mynel++] = sid; in security_get_user_sids()
2849 * __security_genfs_sid - Helper to obtain a SID for a file in a filesystem
2854 * @sid: SID for path
2856 * Obtain a SID to use for a file in a filesystem that
2867 u32 *sid) in __security_genfs_sid() argument
2880 *sid = SECINITSID_UNLABELED; in __security_genfs_sid()
2901 return ocontext_to_sid(sidtab, c, 0, sid); in __security_genfs_sid()
2905 * security_genfs_sid - Obtain a SID for a file in a filesystem
2909 * @sid: SID for path
2917 u32 *sid) in security_genfs_sid() argument
2923 *sid = SECINITSID_UNLABELED; in security_genfs_sid()
2931 orig_sclass, sid); in security_genfs_sid()
2941 u32 *sid) in selinux_policy_genfs_sid() argument
2944 return __security_genfs_sid(policy, fstype, path, orig_sclass, sid); in selinux_policy_genfs_sid()
2963 sbsec->sid = SECINITSID_UNLABELED; in security_fs_use()
2982 rc = ocontext_to_sid(sidtab, c, 0, &sbsec->sid); in security_fs_use()
2991 SECCLASS_DIR, &sbsec->sid); in security_fs_use()
3189 * security_sid_mls_copy() - computes a new sid based on the given
3190 * sid and the mls portion of mls_sid.
3192 int security_sid_mls_copy(u32 sid, u32 mls_sid, u32 *new_sid) in security_sid_mls_copy() argument
3205 *new_sid = sid; in security_sid_mls_copy()
3219 *new_sid = sid; in security_sid_mls_copy()
3224 context1 = sidtab_search(sidtab, sid); in security_sid_mls_copy()
3226 pr_err("SELinux: %s: unrecognized SID %d\n", in security_sid_mls_copy()
3227 __func__, sid); in security_sid_mls_copy()
3234 pr_err("SELinux: %s: unrecognized SID %d\n", in security_sid_mls_copy()
3282 * @nlbl_sid: NetLabel SID
3284 * @xfrm_sid: XFRM SID
3285 * @peer_sid: network peer sid
3289 * resolved into a single SID it is returned via @peer_sid and the function
3293 * | function return | @sid
3316 * single or absent peer SID/label */ in security_net_peersid_resolve()
3322 * and is treated as if nlbl_sid == SECSID_NULL when a XFRM SID/label in security_net_peersid_resolve()
3350 pr_err("SELinux: %s: unrecognized SID %d\n", in security_net_peersid_resolve()
3357 pr_err("SELinux: %s: unrecognized SID %d\n", in security_net_peersid_resolve()
3366 * information so if the MLS portion of the NetLabel SID in security_net_peersid_resolve()
3367 * matches the MLS portion of the labeled XFRM SID/label in security_net_peersid_resolve()
3368 * then pass along the XFRM SID as it is the most in security_net_peersid_resolve()
3701 WARN_ONCE(1, "selinux_audit_rule_match: unrecognized SID %d\n", in selinux_audit_rule_match()
3810 * @sid: the SELinux SID
3819 u32 sid) in security_netlbl_cache_add() argument
3832 *sid_cache = sid; in security_netlbl_cache_add()
3839 * security_netlbl_secattr_to_sid - Convert a NetLabel secattr to a SELinux SID
3841 * @sid: the SELinux SID
3845 * SELinux SID. If the @secattr field does not contain a full SELinux
3846 * SID/context then use SECINITSID_NETMSG as the foundation. If possible the
3848 * allow the @secattr to be used by NetLabel to cache the secattr to SID
3854 u32 *sid) in security_netlbl_secattr_to_sid() argument
3864 *sid = SECSID_NULL; in security_netlbl_secattr_to_sid()
3876 *sid = *(u32 *)secattr->cache->data; in security_netlbl_secattr_to_sid()
3878 *sid = secattr->attr.secid; in security_netlbl_secattr_to_sid()
3901 rc = sidtab_context_to_sid(sidtab, &ctx_new, sid); in security_netlbl_secattr_to_sid()
3910 security_netlbl_cache_add(secattr, *sid); in security_netlbl_secattr_to_sid()
3912 *sid = SECSID_NULL; in security_netlbl_secattr_to_sid()
3920 * security_netlbl_sid_to_secattr - Convert a SELinux SID to a NetLabel secattr
3921 * @sid: the SELinux SID
3925 * Convert the given SELinux SID in @sid into a NetLabel security attribute.
3929 int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr) in security_netlbl_sid_to_secattr() argument
3944 ctx = sidtab_search(policy->sidtab, sid); in security_netlbl_sid_to_secattr()
3954 secattr->attr.secid = sid; in security_netlbl_sid_to_secattr()