Lines Matching full:sid

217 	tsec->osid = tsec->sid = SECINITSID_KERNEL;  in cred_init_security()
228 return tsec->sid; in cred_sid()
236 u32 sid; in task_sid_obj() local
239 sid = cred_sid(__task_cred(task)); in task_sid_obj()
241 return sid; in task_sid_obj()
399 static int may_context_mount_sb_relabel(u32 sid, in may_context_mount_sb_relabel() argument
407 tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
413 tsec->sid, sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
418 static int may_context_mount_inode_relabel(u32 sid, in may_context_mount_inode_relabel() argument
425 tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_inode_relabel()
431 sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_inode_relabel()
482 u32 sid; in sb_check_xattr_support() local
515 SECCLASS_DIR, &sid); in sb_check_xattr_support()
522 sbsec->sid = sid; in sb_check_xattr_support()
662 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, in selinux_set_mnt_opts()
676 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, in selinux_set_mnt_opts()
761 sbsec->sid = fscontext_sid; in selinux_set_mnt_opts()
780 sbsec->sid = context_sid; in selinux_set_mnt_opts()
800 root_isec->sid = rootcontext_sid; in selinux_set_mnt_opts()
846 if ((oldflags & FSCONTEXT_MNT) && old->sid != new->sid) in selinux_cmp_sb_context()
855 if (oldroot->sid != newroot->sid) in selinux_cmp_sb_context()
908 newsbsec->sid = oldsbsec->sid; in selinux_sb_clone_mnt_opts()
925 u32 sid = oldsbsec->mntpoint_sid; in selinux_sb_clone_mnt_opts() local
928 newsbsec->sid = sid; in selinux_sb_clone_mnt_opts()
931 newisec->sid = sid; in selinux_sb_clone_mnt_opts()
933 newsbsec->mntpoint_sid = sid; in selinux_sb_clone_mnt_opts()
939 newisec->sid = oldisec->sid; in selinux_sb_clone_mnt_opts()
1011 static int show_sid(struct seq_file *m, u32 sid) in show_sid() argument
1017 rc = security_sid_to_context(&selinux_state, sid, in show_sid()
1047 rc = show_sid(m, sbsec->sid); in selinux_sb_show_options()
1070 rc = show_sid(m, isec->sid); in selinux_sb_show_options()
1272 u32 *sid) in selinux_genfs_get_sid() argument
1296 path, tclass, sid); in selinux_genfs_get_sid()
1299 *sid = SECINITSID_UNLABELED; in selinux_genfs_get_sid()
1308 u32 def_sid, u32 *sid) in inode_doinit_use_xattr() argument
1346 *sid = def_sid; in inode_doinit_use_xattr()
1350 rc = security_context_to_sid_default(&selinux_state, context, rc, sid, in inode_doinit_use_xattr()
1373 u32 task_sid, sid = 0; in inode_doinit_with_dentry() local
1402 sid = isec->sid; in inode_doinit_with_dentry()
1411 sid = sbsec->def_sid; in inode_doinit_with_dentry()
1444 &sid); in inode_doinit_with_dentry()
1450 sid = task_sid; in inode_doinit_with_dentry()
1453 /* Default to the fs SID. */ in inode_doinit_with_dentry()
1454 sid = sbsec->sid; in inode_doinit_with_dentry()
1456 /* Try to obtain a transition SID. */ in inode_doinit_with_dentry()
1457 rc = security_transition_sid(&selinux_state, task_sid, sid, in inode_doinit_with_dentry()
1458 sclass, NULL, &sid); in inode_doinit_with_dentry()
1463 sid = sbsec->mntpoint_sid; in inode_doinit_with_dentry()
1466 /* Default to the fs superblock SID. */ in inode_doinit_with_dentry()
1467 sid = sbsec->sid; in inode_doinit_with_dentry()
1499 sbsec->flags, &sid); in inode_doinit_with_dentry()
1508 sid, &sid); in inode_doinit_with_dentry()
1527 isec->sid = sid; in inode_doinit_with_dentry()
1538 isec->sid = sid; in inode_doinit_with_dentry()
1582 u32 sid = cred_sid(cred); in cred_has_capability() local
1603 sid, sid, sclass, av, 0, &avd); in cred_has_capability()
1606 sid, sid, sclass, av, &avd, rc, &ad); in cred_has_capability()
1622 u32 sid; in inode_has_perm() local
1629 sid = cred_sid(cred); in inode_has_perm()
1633 sid, isec->sid, isec->sclass, perms, adp); in inode_has_perm()
1681 static int bpf_fd_pass(struct file *file, u32 sid);
1689 has the same SID as the process. If av is zero, then
1699 u32 sid = cred_sid(cred); in file_has_perm() local
1705 if (sid != fsec->sid) { in file_has_perm()
1707 sid, fsec->sid, in file_has_perm()
1750 return security_transition_sid(&selinux_state, tsec->sid, in selinux_determine_inode_label()
1751 dsec->sid, tclass, in selinux_determine_inode_label()
1766 u32 sid, newsid; in may_create() local
1773 sid = tsec->sid; in may_create()
1779 sid, dsec->sid, SECCLASS_DIR, in may_create()
1791 sid, newsid, tclass, FILE__CREATE, &ad); in may_create()
1796 newsid, sbsec->sid, in may_create()
1813 u32 sid = current_sid(); in may_link() local
1826 sid, dsec->sid, SECCLASS_DIR, av, &ad); in may_link()
1847 sid, isec->sid, isec->sclass, av, &ad); in may_link()
1858 u32 sid = current_sid(); in may_rename() local
1872 sid, old_dsec->sid, SECCLASS_DIR, in may_rename()
1877 sid, old_isec->sid, in may_rename()
1883 sid, old_isec->sid, in may_rename()
1894 sid, new_dsec->sid, SECCLASS_DIR, av, &ad); in may_rename()
1901 sid, new_isec->sid, in may_rename()
1918 u32 sid = cred_sid(cred); in superblock_has_perm() local
1922 sid, sbsec->sid, SECCLASS_FILESYSTEM, perms, ad); in superblock_has_perm()
2034 u32 sid = cred_sid(to); in selinux_binder_transfer_file() local
2044 if (sid != fsec->sid) { in selinux_binder_transfer_file()
2046 sid, fsec->sid, in selinux_binder_transfer_file()
2055 rc = bpf_fd_pass(file, sid); in selinux_binder_transfer_file()
2065 sid, isec->sid, isec->sclass, file_to_av(file), in selinux_binder_transfer_file()
2072 u32 sid = current_sid(); in selinux_ptrace_access_check() local
2077 sid, csid, SECCLASS_FILE, FILE__READ, NULL); in selinux_ptrace_access_check()
2080 sid, csid, SECCLASS_PROCESS, PROCESS__PTRACE, NULL); in selinux_ptrace_access_check()
2213 u32 sid = 0; in ptrace_parent_sid() local
2219 sid = task_sid_obj(tracer); in ptrace_parent_sid()
2222 return sid; in ptrace_parent_sid()
2237 if (new_tsec->sid == old_tsec->sid) in check_nnp_nosuid()
2253 old_tsec->sid, new_tsec->sid, in check_nnp_nosuid()
2262 * of the permissions of the current SID. in check_nnp_nosuid()
2264 rc = security_bounded_transition(&selinux_state, old_tsec->sid, in check_nnp_nosuid()
2265 new_tsec->sid); in check_nnp_nosuid()
2295 /* Default to the current task SID. */ in selinux_bprm_creds_for_exec()
2296 new_tsec->sid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2297 new_tsec->osid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2305 new_tsec->sid = old_tsec->exec_sid; in selinux_bprm_creds_for_exec()
2306 /* Reset exec SID on execve. */ in selinux_bprm_creds_for_exec()
2315 rc = security_transition_sid(&selinux_state, old_tsec->sid, in selinux_bprm_creds_for_exec()
2316 isec->sid, SECCLASS_PROCESS, NULL, in selinux_bprm_creds_for_exec()
2317 &new_tsec->sid); in selinux_bprm_creds_for_exec()
2322 * Fallback to old SID on NNP or nosuid if not an allowed in selinux_bprm_creds_for_exec()
2327 new_tsec->sid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2333 if (new_tsec->sid == old_tsec->sid) { in selinux_bprm_creds_for_exec()
2335 old_tsec->sid, isec->sid, in selinux_bprm_creds_for_exec()
2342 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2348 new_tsec->sid, isec->sid, in selinux_bprm_creds_for_exec()
2356 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2364 * changes its SID has the appropriate permit */ in selinux_bprm_creds_for_exec()
2369 ptsid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2384 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2457 if (new_tsec->sid == new_tsec->osid) in selinux_bprm_committing_creds()
2460 /* Close files for which the new task SID is not authorized. */ in selinux_bprm_committing_creds()
2463 /* Always clear parent death signal on SID transitions. */ in selinux_bprm_committing_creds()
2466 /* Check whether the new SID can inherit resource limits from the old in selinux_bprm_committing_creds()
2467 * SID. If not, reset all soft limits to the lower of the current in selinux_bprm_committing_creds()
2477 new_tsec->osid, new_tsec->sid, SECCLASS_PROCESS, in selinux_bprm_committing_creds()
2500 u32 osid, sid; in selinux_bprm_committed_creds() local
2504 sid = tsec->sid; in selinux_bprm_committed_creds()
2506 if (sid == osid) in selinux_bprm_committed_creds()
2509 /* Check whether the new SID can inherit signal state from the old SID. in selinux_bprm_committed_creds()
2513 * This must occur _after_ the task SID has been updated so that any in selinux_bprm_committed_creds()
2514 * kill done after the flush will be checked against the new SID. in selinux_bprm_committed_creds()
2517 osid, sid, SECCLASS_PROCESS, PROCESS__SIGINH, NULL); in selinux_bprm_committed_creds()
2533 * wait permission to the new task SID. */ in selinux_bprm_committed_creds()
2548 sbsec->sid = SECINITSID_UNLABELED; in selinux_sb_alloc_security()
2651 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, in selinux_sb_mnt_opts_compat()
2664 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, in selinux_sb_mnt_opts_compat()
2688 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, in selinux_sb_remount()
2700 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, in selinux_sb_remount()
2808 u32 sid = current_sid(); in selinux_inode_alloc_security() local
2813 isec->sid = SECINITSID_UNLABELED; in selinux_inode_alloc_security()
2815 isec->task_sid = sid; in selinux_inode_alloc_security()
2894 isec->sid = newsid; in selinux_inode_init_security()
2946 isec->sid = context_isec->sid; in selinux_inode_init_security_anon()
2950 &selinux_state, tsec->sid, tsec->sid, in selinux_inode_init_security_anon()
2951 isec->sclass, name, &isec->sid); in selinux_inode_init_security_anon()
2966 tsec->sid, in selinux_inode_init_security_anon()
2967 isec->sid, in selinux_inode_init_security_anon()
3027 u32 sid; in selinux_inode_follow_link() local
3033 sid = cred_sid(cred); in selinux_inode_follow_link()
3039 sid, isec->sid, isec->sclass, FILE__READ, &ad); in selinux_inode_follow_link()
3053 current_sid(), isec->sid, isec->sclass, perms, in audit_inode_permission()
3064 u32 sid; in selinux_inode_permission() local
3083 sid = cred_sid(cred); in selinux_inode_permission()
3089 sid, isec->sid, isec->sclass, perms, 0, in selinux_inode_permission()
3156 u32 newsid, sid = current_sid(); in selinux_inode_setxattr() local
3184 sid, isec->sid, isec->sclass, in selinux_inode_setxattr()
3225 sid, newsid, isec->sclass, in selinux_inode_setxattr()
3230 rc = security_validate_transition(&selinux_state, isec->sid, newsid, in selinux_inode_setxattr()
3231 sid, isec->sclass); in selinux_inode_setxattr()
3237 sbsec->sid, in selinux_inode_setxattr()
3269 pr_err("SELinux: unable to map context to SID" in selinux_inode_post_setxattr()
3278 isec->sid = newsid; in selinux_inode_post_setxattr()
3396 isec->sid, &context, in selinux_inode_getsecurity()
3399 error = security_sid_to_context(&selinux_state, isec->sid, in selinux_inode_getsecurity()
3438 isec->sid = newsid; in selinux_inode_setsecurity()
3459 *secid = isec->sid; in selinux_inode_getsecid()
3464 u32 sid; in selinux_inode_copy_up() local
3476 selinux_inode_getsecid(d_inode(src), &sid); in selinux_inode_copy_up()
3477 tsec->create_sid = sid; in selinux_inode_copy_up()
3539 rc = security_transition_sid(&selinux_state, tsec->sid, in selinux_kernfs_init_security()
3578 u32 sid = current_sid(); in selinux_file_permission() local
3585 if (sid == fsec->sid && fsec->isid == isec->sid && in selinux_file_permission()
3596 u32 sid = current_sid(); in selinux_file_alloc_security() local
3598 fsec->sid = sid; in selinux_file_alloc_security()
3599 fsec->fown_sid = sid; in selinux_file_alloc_security()
3626 if (ssid != fsec->sid) { in ioctl_has_perm()
3628 ssid, fsec->sid, in ioctl_has_perm()
3641 ssid, isec->sid, isec->sclass, in ioctl_has_perm()
3699 u32 sid = cred_sid(cred); in file_map_prot_check() local
3711 sid, sid, SECCLASS_PROCESS, in file_map_prot_check()
3740 u32 sid = current_sid(); in selinux_mmap_addr() local
3742 sid, sid, SECCLASS_MEMPROTECT, in selinux_mmap_addr()
3776 u32 sid = cred_sid(cred); in selinux_file_mprotect() local
3787 sid, sid, SECCLASS_PROCESS, in selinux_file_mprotect()
3794 sid, sid, SECCLASS_PROCESS, in selinux_file_mprotect()
3872 u32 sid = task_sid_obj(tsk); in selinux_file_send_sigiotask() local
3887 fsec->fown_sid, sid, in selinux_file_send_sigiotask()
3910 * struct as its SID. in selinux_file_open()
3912 fsec->isid = isec->sid; in selinux_file_open()
3930 u32 sid = current_sid(); in selinux_task_alloc() local
3933 sid, sid, SECCLASS_PROCESS, PROCESS__FORK, NULL); in selinux_task_alloc()
3972 u32 sid = current_sid(); in selinux_kernel_act_as() local
3976 sid, secid, in selinux_kernel_act_as()
3981 tsec->sid = secid; in selinux_kernel_act_as()
3997 u32 sid = current_sid(); in selinux_kernel_create_files_as() local
4001 sid, isec->sid, in selinux_kernel_create_files_as()
4007 tsec->create_sid = isec->sid; in selinux_kernel_create_files_as()
4028 u32 sid = current_sid(); in selinux_kernel_module_from_file() local
4034 sid, sid, SECCLASS_SYSTEM, in selinux_kernel_module_from_file()
4043 if (sid != fsec->sid) { in selinux_kernel_module_from_file()
4045 sid, fsec->sid, SECCLASS_FD, FD__USE, &ad); in selinux_kernel_module_from_file()
4052 sid, isec->sid, SECCLASS_SYSTEM, in selinux_kernel_module_from_file()
4216 u32 sid = task_sid_obj(p); in selinux_task_to_inode() local
4220 isec->sid = sid; in selinux_task_to_inode()
4227 u32 sid = current_sid(); in selinux_userns_create() local
4229 return avc_has_perm(&selinux_state, sid, sid, SECCLASS_USER_NAMESPACE, in selinux_userns_create()
4463 * @sid: the packet's peer label SID
4467 * the peer label/SID for the packet; most of the magic actually occurs in
4469 * returns zero if the value in @sid is valid (although it may be SECSID_NULL)
4470 * or -EACCES if @sid is invalid due to inconsistencies with the different
4474 static int selinux_skb_peerlbl_sid(struct sk_buff *skb, u16 family, u32 *sid) in selinux_skb_peerlbl_sid() argument
4489 nlbl_type, xfrm_sid, sid); in selinux_skb_peerlbl_sid()
4502 * @sk_sid: the parent socket's SID
4503 * @skb_sid: the packet's SID
4504 * @conn_sid: the resulting connection SID
4535 return security_transition_sid(&selinux_state, tsec->sid, tsec->sid, in socket_sockcreate_sid()
4545 if (sksec->sid == SECINITSID_KERNEL) in sock_has_perm()
4553 current_sid(), sksec->sid, sksec->sclass, perms, in sock_has_perm()
4574 tsec->sid, newsid, secclass, SOCKET__CREATE, NULL); in selinux_socket_create()
4584 u32 sid = SECINITSID_KERNEL; in selinux_socket_post_create() local
4588 err = socket_sockcreate_sid(tsec, sclass, &sid); in selinux_socket_post_create()
4594 isec->sid = sid; in selinux_socket_post_create()
4600 sksec->sid = sid; in selinux_socket_post_create()
4617 sksec_a->peer_sid = sksec_b->sid; in selinux_socket_socketpair()
4618 sksec_b->peer_sid = sksec_a->sid; in selinux_socket_socketpair()
4648 u32 sid, node_perm; in selinux_socket_bind() local
4700 snum, &sid); in selinux_socket_bind()
4704 sksec->sid, sid, in selinux_socket_bind()
4734 err = sel_netnode_sid(addrp, family_sa, &sid); in selinux_socket_bind()
4744 sksec->sid, sid, in selinux_socket_bind()
4792 u32 sid, perm; in selinux_socket_connect_helper() local
4822 err = sel_netport_sid(sk->sk_protocol, snum, &sid); in selinux_socket_connect_helper()
4843 sksec->sid, sid, sksec->sclass, perm, &ad); in selinux_socket_connect_helper()
4876 u32 sid; in selinux_socket_accept() local
4885 sid = isec->sid; in selinux_socket_accept()
4890 newisec->sid = sid; in selinux_socket_accept()
4956 sksec_sock->sid, sksec_other->sid, in selinux_socket_unix_stream_connect()
4963 sksec_new->peer_sid = sksec_sock->sid; in selinux_socket_unix_stream_connect()
4964 err = security_sid_mls_copy(&selinux_state, sksec_other->sid, in selinux_socket_unix_stream_connect()
4965 sksec_sock->sid, &sksec_new->sid); in selinux_socket_unix_stream_connect()
4970 sksec_sock->peer_sid = sksec_new->sid; in selinux_socket_unix_stream_connect()
4988 ssec->sid, osec->sid, osec->sclass, SOCKET__SENDTO, in selinux_socket_unix_may_send()
5022 u32 sk_sid = sksec->sid; in selinux_sock_rcv_skb_compat()
5046 err = selinux_xfrm_sock_rcv_skb(sksec->sid, skb, &ad); in selinux_sock_rcv_skb_compat()
5056 u32 sk_sid = sksec->sid; in selinux_socket_sock_rcv_skb()
5175 peer_secid = isec->sid; in selinux_socket_getpeersec_dgram()
5195 sksec->sid = SECINITSID_UNLABELED; in selinux_sk_alloc_security()
5217 newsksec->sid = sksec->sid; in selinux_sk_clone_security()
5231 *secid = sksec->sid; in selinux_sk_getsecid()
5243 isec->sid = sksec->sid; in selinux_sock_graft()
5284 /* Here as first association on socket. As the peer SID in selinux_sctp_process_new_assoc()
5287 * peer SID for getpeercon(3). in selinux_sctp_process_new_assoc()
5331 err = selinux_conn_sid(sksec->sid, asoc->peer_secid, &conn_sid); in selinux_sctp_assoc_request()
5356 asoc->secid = sksec->sid; in selinux_sctp_assoc_established()
5455 newsksec->sid = asoc->secid; in selinux_sctp_sk_clone()
5473 err = selinux_conn_sid(sksec->sid, peersid, &connsid); in selinux_inet_conn_request()
5487 newsksec->sid = req->secid; in selinux_inet_csk_clone()
5489 /* NOTE: Ideally, we should also get the isec->sid for the in selinux_inet_csk_clone()
5511 static int selinux_secmark_relabel_packet(u32 sid) in selinux_secmark_relabel_packet() argument
5517 tsid = __tsec->sid; in selinux_secmark_relabel_packet()
5520 tsid, sid, SECCLASS_PACKET, PACKET__RELABELTO, in selinux_secmark_relabel_packet()
5547 tunsec->sid = current_sid(); in selinux_tun_dev_alloc_security()
5560 u32 sid = current_sid(); in selinux_tun_dev_create() local
5562 /* we aren't taking into account the "sockcreate" SID since the socket in selinux_tun_dev_create()
5570 sid, sid, SECCLASS_TUN_SOCKET, TUN_SOCKET__CREATE, in selinux_tun_dev_create()
5579 current_sid(), tunsec->sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_attach_queue()
5595 sksec->sid = tunsec->sid; in selinux_tun_dev_attach()
5604 u32 sid = current_sid(); in selinux_tun_dev_open() local
5608 sid, tunsec->sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_open()
5613 sid, sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_open()
5617 tunsec->sid = sid; in selinux_tun_dev_open()
5687 u32 sid; in selinux_ip_output() local
5716 sid = sksec->sid; in selinux_ip_output()
5718 sid = SECINITSID_KERNEL; in selinux_ip_output()
5719 if (selinux_netlbl_skbuff_setsid(skb, state->pf, sid) != 0) in selinux_ip_output()
5749 sksec->sid, skb->secmark, in selinux_ip_postroute_compat()
5753 if (selinux_xfrm_postroute_last(sksec->sid, skb, &ad, proto)) in selinux_ip_postroute_compat()
5854 if (selinux_conn_sid(sksec->sid, skb_sid, &peer_sid)) in selinux_ip_postroute()
5861 peer_sid = sksec->sid; in selinux_ip_postroute()
5963 isec->sid = current_sid(); in ipc_init_security()
5971 u32 sid = current_sid(); in ipc_has_perm() local
5979 sid, isec->sid, isec->sclass, perms, &ad); in ipc_has_perm()
5987 msec->sid = SECINITSID_UNLABELED; in selinux_msg_msg_alloc_security()
5997 u32 sid = current_sid(); in selinux_msg_queue_alloc_security() local
6006 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_alloc_security()
6014 u32 sid = current_sid(); in selinux_msg_queue_associate() local
6022 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_associate()
6062 u32 sid = current_sid(); in selinux_msg_queue_msgsnd() local
6071 if (msec->sid == SECINITSID_UNLABELED) { in selinux_msg_queue_msgsnd()
6073 * Compute new sid based on current process and in selinux_msg_queue_msgsnd()
6076 rc = security_transition_sid(&selinux_state, sid, isec->sid, in selinux_msg_queue_msgsnd()
6077 SECCLASS_MSG, NULL, &msec->sid); in selinux_msg_queue_msgsnd()
6087 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_msgsnd()
6092 sid, msec->sid, SECCLASS_MSG, in selinux_msg_queue_msgsnd()
6097 msec->sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_msgsnd()
6110 u32 sid = task_sid_obj(target); in selinux_msg_queue_msgrcv() local
6120 sid, isec->sid, in selinux_msg_queue_msgrcv()
6124 sid, msec->sid, in selinux_msg_queue_msgrcv()
6134 u32 sid = current_sid(); in selinux_shm_alloc_security() local
6143 sid, isec->sid, SECCLASS_SHM, in selinux_shm_alloc_security()
6151 u32 sid = current_sid(); in selinux_shm_associate() local
6159 sid, isec->sid, SECCLASS_SHM, in selinux_shm_associate()
6217 u32 sid = current_sid(); in selinux_sem_alloc_security() local
6226 sid, isec->sid, SECCLASS_SEM, in selinux_sem_alloc_security()
6234 u32 sid = current_sid(); in selinux_sem_associate() local
6242 sid, isec->sid, SECCLASS_SEM, in selinux_sem_associate()
6323 *secid = isec->sid; in selinux_ipc_getsecid()
6336 u32 sid; in selinux_getprocattr() local
6345 current_sid(), __tsec->sid, in selinux_getprocattr()
6352 sid = __tsec->sid; in selinux_getprocattr()
6354 sid = __tsec->osid; in selinux_getprocattr()
6356 sid = __tsec->exec_sid; in selinux_getprocattr()
6358 sid = __tsec->create_sid; in selinux_getprocattr()
6360 sid = __tsec->keycreate_sid; in selinux_getprocattr()
6362 sid = __tsec->sockcreate_sid; in selinux_getprocattr()
6369 if (!sid) in selinux_getprocattr()
6372 error = security_sid_to_context(&selinux_state, sid, value, &len); in selinux_getprocattr()
6386 u32 mysid = current_sid(), sid = 0, ptsid; in selinux_setprocattr() local
6418 /* Obtain a SID for the context, if one was specified. */ in selinux_setprocattr()
6425 &sid, GFP_KERNEL); in selinux_setprocattr()
6450 value, size, &sid); in selinux_setprocattr()
6468 tsec->exec_sid = sid; in selinux_setprocattr()
6470 tsec->create_sid = sid; in selinux_setprocattr()
6472 if (sid) { in selinux_setprocattr()
6473 error = avc_has_perm(&selinux_state, mysid, sid, in selinux_setprocattr()
6478 tsec->keycreate_sid = sid; in selinux_setprocattr()
6480 tsec->sockcreate_sid = sid; in selinux_setprocattr()
6483 if (sid == 0) in selinux_setprocattr()
6489 tsec->sid, sid); in selinux_setprocattr()
6496 tsec->sid, sid, SECCLASS_PROCESS, in selinux_setprocattr()
6501 /* Check for ptracing, and update the task SID if ok. in selinux_setprocattr()
6502 Otherwise, leave SID unchanged and fail. */ in selinux_setprocattr()
6506 ptsid, sid, SECCLASS_PROCESS, in selinux_setprocattr()
6512 tsec->sid = sid; in selinux_setprocattr()
6601 ksec->sid = tsec->keycreate_sid; in selinux_key_alloc()
6603 ksec->sid = tsec->sid; in selinux_key_alloc()
6623 u32 perm, sid; in selinux_key_permission() local
6655 sid = cred_sid(cred); in selinux_key_permission()
6660 sid, ksec->sid, SECCLASS_KEY, perm, NULL); in selinux_key_permission()
6670 rc = security_sid_to_context(&selinux_state, ksec->sid, in selinux_key_getsecurity()
6682 u32 sid = current_sid(); in selinux_watch_key() local
6685 sid, ksec->sid, SECCLASS_KEY, KEY__VIEW, NULL); in selinux_watch_key()
6695 u32 sid = 0; in selinux_ib_pkey_access() local
6699 err = sel_ib_pkey_sid(subnet_prefix, pkey_val, &sid); in selinux_ib_pkey_access()
6708 sec->sid, sid, in selinux_ib_pkey_access()
6718 u32 sid = 0; in selinux_ib_endport_manage_subnet() local
6723 &sid); in selinux_ib_endport_manage_subnet()
6733 sec->sid, sid, in selinux_ib_endport_manage_subnet()
6745 sec->sid = current_sid(); in selinux_ib_alloc_security()
6761 u32 sid = current_sid(); in selinux_bpf() local
6767 sid, sid, SECCLASS_BPF, BPF__MAP_CREATE, in selinux_bpf()
6772 sid, sid, SECCLASS_BPF, BPF__PROG_LOAD, in selinux_bpf()
6802 static int bpf_fd_pass(struct file *file, u32 sid) in bpf_fd_pass() argument
6813 sid, bpfsec->sid, SECCLASS_BPF, in bpf_fd_pass()
6821 sid, bpfsec->sid, SECCLASS_BPF, in bpf_fd_pass()
6831 u32 sid = current_sid(); in selinux_bpf_map() local
6836 sid, bpfsec->sid, SECCLASS_BPF, in selinux_bpf_map()
6842 u32 sid = current_sid(); in selinux_bpf_prog() local
6847 sid, bpfsec->sid, SECCLASS_BPF, in selinux_bpf_prog()
6859 bpfsec->sid = current_sid(); in selinux_bpf_map_alloc()
6881 bpfsec->sid = current_sid(); in selinux_bpf_prog_alloc()
6908 u32 requested, sid = current_sid(); in selinux_perf_event_open() local
6921 return avc_has_perm(&selinux_state, sid, sid, SECCLASS_PERF_EVENT, in selinux_perf_event_open()
6933 perfsec->sid = current_sid(); in selinux_perf_event_alloc()
6950 u32 sid = current_sid(); in selinux_perf_event_read() local
6952 return avc_has_perm(&selinux_state, sid, perfsec->sid, in selinux_perf_event_read()
6959 u32 sid = current_sid(); in selinux_perf_event_write() local
6961 return avc_has_perm(&selinux_state, sid, perfsec->sid, in selinux_perf_event_write()
6988 int sid = current_sid(); in selinux_uring_sqpoll() local
6990 return avc_has_perm(&selinux_state, sid, sid, in selinux_uring_sqpoll()
7012 return avc_has_perm(&selinux_state, current_sid(), isec->sid, in selinux_uring_cmd()