Lines Matching refs:sid
218 tsec->osid = tsec->sid = SECINITSID_KERNEL; in cred_init_security()
229 return tsec->sid; in cred_sid()
237 u32 sid; in task_sid_subj() local
240 sid = cred_sid(rcu_dereference(task->cred)); in task_sid_subj()
242 return sid; in task_sid_subj()
250 u32 sid; in task_sid_obj() local
253 sid = cred_sid(__task_cred(task)); in task_sid_obj()
255 return sid; in task_sid_obj()
415 static int may_context_mount_sb_relabel(u32 sid, in may_context_mount_sb_relabel() argument
423 tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
429 tsec->sid, sid, SECCLASS_FILESYSTEM, in may_context_mount_sb_relabel()
434 static int may_context_mount_inode_relabel(u32 sid, in may_context_mount_inode_relabel() argument
441 tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_inode_relabel()
447 sid, sbsec->sid, SECCLASS_FILESYSTEM, in may_context_mount_inode_relabel()
498 u32 sid; in sb_check_xattr_support() local
531 SECCLASS_DIR, &sid); in sb_check_xattr_support()
538 sbsec->sid = sid; in sb_check_xattr_support()
614 static int parse_sid(struct super_block *sb, const char *s, u32 *sid, in parse_sid() argument
618 sid, gfp); in parse_sid()
693 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, in selinux_set_mnt_opts()
713 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, in selinux_set_mnt_opts()
801 sbsec->sid = fscontext_sid; in selinux_set_mnt_opts()
820 sbsec->sid = context_sid; in selinux_set_mnt_opts()
840 root_isec->sid = rootcontext_sid; in selinux_set_mnt_opts()
886 if ((oldflags & FSCONTEXT_MNT) && old->sid != new->sid) in selinux_cmp_sb_context()
895 if (oldroot->sid != newroot->sid) in selinux_cmp_sb_context()
948 newsbsec->sid = oldsbsec->sid; in selinux_sb_clone_mnt_opts()
965 u32 sid = oldsbsec->mntpoint_sid; in selinux_sb_clone_mnt_opts() local
968 newsbsec->sid = sid; in selinux_sb_clone_mnt_opts()
971 newisec->sid = sid; in selinux_sb_clone_mnt_opts()
973 newsbsec->mntpoint_sid = sid; in selinux_sb_clone_mnt_opts()
979 newisec->sid = oldisec->sid; in selinux_sb_clone_mnt_opts()
1069 static int show_sid(struct seq_file *m, u32 sid) in show_sid() argument
1075 rc = security_sid_to_context(&selinux_state, sid, in show_sid()
1105 rc = show_sid(m, sbsec->sid); in selinux_sb_show_options()
1128 rc = show_sid(m, isec->sid); in selinux_sb_show_options()
1330 u32 *sid) in selinux_genfs_get_sid() argument
1354 path, tclass, sid); in selinux_genfs_get_sid()
1357 *sid = SECINITSID_UNLABELED; in selinux_genfs_get_sid()
1366 u32 def_sid, u32 *sid) in inode_doinit_use_xattr() argument
1404 *sid = def_sid; in inode_doinit_use_xattr()
1408 rc = security_context_to_sid_default(&selinux_state, context, rc, sid, in inode_doinit_use_xattr()
1431 u32 task_sid, sid = 0; in inode_doinit_with_dentry() local
1460 sid = isec->sid; in inode_doinit_with_dentry()
1469 sid = sbsec->def_sid; in inode_doinit_with_dentry()
1502 &sid); in inode_doinit_with_dentry()
1508 sid = task_sid; in inode_doinit_with_dentry()
1512 sid = sbsec->sid; in inode_doinit_with_dentry()
1515 rc = security_transition_sid(&selinux_state, task_sid, sid, in inode_doinit_with_dentry()
1516 sclass, NULL, &sid); in inode_doinit_with_dentry()
1521 sid = sbsec->mntpoint_sid; in inode_doinit_with_dentry()
1525 sid = sbsec->sid; in inode_doinit_with_dentry()
1557 sbsec->flags, &sid); in inode_doinit_with_dentry()
1566 sid, &sid); in inode_doinit_with_dentry()
1585 isec->sid = sid; in inode_doinit_with_dentry()
1596 isec->sid = sid; in inode_doinit_with_dentry()
1640 u32 sid = cred_sid(cred); in cred_has_capability() local
1661 sid, sid, sclass, av, 0, &avd); in cred_has_capability()
1664 sid, sid, sclass, av, &avd, rc, &ad); in cred_has_capability()
1680 u32 sid; in inode_has_perm() local
1687 sid = cred_sid(cred); in inode_has_perm()
1691 sid, isec->sid, isec->sclass, perms, adp); in inode_has_perm()
1739 static int bpf_fd_pass(struct file *file, u32 sid);
1757 u32 sid = cred_sid(cred); in file_has_perm() local
1763 if (sid != fsec->sid) { in file_has_perm()
1765 sid, fsec->sid, in file_has_perm()
1808 return security_transition_sid(&selinux_state, tsec->sid, in selinux_determine_inode_label()
1809 dsec->sid, tclass, in selinux_determine_inode_label()
1824 u32 sid, newsid; in may_create() local
1831 sid = tsec->sid; in may_create()
1837 sid, dsec->sid, SECCLASS_DIR, in may_create()
1849 sid, newsid, tclass, FILE__CREATE, &ad); in may_create()
1854 newsid, sbsec->sid, in may_create()
1871 u32 sid = current_sid(); in may_link() local
1884 sid, dsec->sid, SECCLASS_DIR, av, &ad); in may_link()
1905 sid, isec->sid, isec->sclass, av, &ad); in may_link()
1916 u32 sid = current_sid(); in may_rename() local
1930 sid, old_dsec->sid, SECCLASS_DIR, in may_rename()
1935 sid, old_isec->sid, in may_rename()
1941 sid, old_isec->sid, in may_rename()
1952 sid, new_dsec->sid, SECCLASS_DIR, av, &ad); in may_rename()
1959 sid, new_isec->sid, in may_rename()
1976 u32 sid = cred_sid(cred); in superblock_has_perm() local
1980 sid, sbsec->sid, SECCLASS_FILESYSTEM, perms, ad); in superblock_has_perm()
2092 u32 sid = cred_sid(to); in selinux_binder_transfer_file() local
2102 if (sid != fsec->sid) { in selinux_binder_transfer_file()
2104 sid, fsec->sid, in selinux_binder_transfer_file()
2113 rc = bpf_fd_pass(file, sid); in selinux_binder_transfer_file()
2123 sid, isec->sid, isec->sclass, file_to_av(file), in selinux_binder_transfer_file()
2130 u32 sid = current_sid(); in selinux_ptrace_access_check() local
2135 sid, csid, SECCLASS_FILE, FILE__READ, NULL); in selinux_ptrace_access_check()
2138 sid, csid, SECCLASS_PROCESS, PROCESS__PTRACE, NULL); in selinux_ptrace_access_check()
2271 u32 sid = 0; in ptrace_parent_sid() local
2277 sid = task_sid_obj(tracer); in ptrace_parent_sid()
2280 return sid; in ptrace_parent_sid()
2295 if (new_tsec->sid == old_tsec->sid) in check_nnp_nosuid()
2311 old_tsec->sid, new_tsec->sid, in check_nnp_nosuid()
2322 rc = security_bounded_transition(&selinux_state, old_tsec->sid, in check_nnp_nosuid()
2323 new_tsec->sid); in check_nnp_nosuid()
2354 new_tsec->sid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2355 new_tsec->osid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2363 new_tsec->sid = old_tsec->exec_sid; in selinux_bprm_creds_for_exec()
2373 rc = security_transition_sid(&selinux_state, old_tsec->sid, in selinux_bprm_creds_for_exec()
2374 isec->sid, SECCLASS_PROCESS, NULL, in selinux_bprm_creds_for_exec()
2375 &new_tsec->sid); in selinux_bprm_creds_for_exec()
2385 new_tsec->sid = old_tsec->sid; in selinux_bprm_creds_for_exec()
2391 if (new_tsec->sid == old_tsec->sid) { in selinux_bprm_creds_for_exec()
2393 old_tsec->sid, isec->sid, in selinux_bprm_creds_for_exec()
2400 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2406 new_tsec->sid, isec->sid, in selinux_bprm_creds_for_exec()
2414 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2427 ptsid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2442 old_tsec->sid, new_tsec->sid, in selinux_bprm_creds_for_exec()
2515 if (new_tsec->sid == new_tsec->osid) in selinux_bprm_committing_creds()
2535 new_tsec->osid, new_tsec->sid, SECCLASS_PROCESS, in selinux_bprm_committing_creds()
2558 u32 osid, sid; in selinux_bprm_committed_creds() local
2562 sid = tsec->sid; in selinux_bprm_committed_creds()
2564 if (sid == osid) in selinux_bprm_committed_creds()
2575 osid, sid, SECCLASS_PROCESS, PROCESS__SIGINH, NULL); in selinux_bprm_committed_creds()
2606 sbsec->sid = SECINITSID_UNLABELED; in selinux_sb_alloc_security()
2692 u32 sid; in selinux_sb_mnt_opts_compat() local
2710 rc = parse_sid(sb, opts->fscontext, &sid, GFP_NOWAIT); in selinux_sb_mnt_opts_compat()
2713 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, sid)) in selinux_sb_mnt_opts_compat()
2717 rc = parse_sid(sb, opts->context, &sid, GFP_NOWAIT); in selinux_sb_mnt_opts_compat()
2720 if (bad_option(sbsec, CONTEXT_MNT, sbsec->mntpoint_sid, sid)) in selinux_sb_mnt_opts_compat()
2727 rc = parse_sid(sb, opts->rootcontext, &sid, GFP_NOWAIT); in selinux_sb_mnt_opts_compat()
2730 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, sid)) in selinux_sb_mnt_opts_compat()
2734 rc = parse_sid(sb, opts->defcontext, &sid, GFP_NOWAIT); in selinux_sb_mnt_opts_compat()
2737 if (bad_option(sbsec, DEFCONTEXT_MNT, sbsec->def_sid, sid)) in selinux_sb_mnt_opts_compat()
2747 u32 sid; in selinux_sb_remount() local
2757 rc = parse_sid(sb, opts->fscontext, &sid, GFP_KERNEL); in selinux_sb_remount()
2760 if (bad_option(sbsec, FSCONTEXT_MNT, sbsec->sid, sid)) in selinux_sb_remount()
2764 rc = parse_sid(sb, opts->context, &sid, GFP_KERNEL); in selinux_sb_remount()
2767 if (bad_option(sbsec, CONTEXT_MNT, sbsec->mntpoint_sid, sid)) in selinux_sb_remount()
2773 rc = parse_sid(sb, opts->rootcontext, &sid, GFP_KERNEL); in selinux_sb_remount()
2776 if (bad_option(sbsec, ROOTCONTEXT_MNT, root_isec->sid, sid)) in selinux_sb_remount()
2780 rc = parse_sid(sb, opts->defcontext, &sid, GFP_KERNEL); in selinux_sb_remount()
2783 if (bad_option(sbsec, DEFCONTEXT_MNT, sbsec->def_sid, sid)) in selinux_sb_remount()
2916 u32 sid = current_sid(); in selinux_inode_alloc_security() local
2921 isec->sid = SECINITSID_UNLABELED; in selinux_inode_alloc_security()
2923 isec->task_sid = sid; in selinux_inode_alloc_security()
3002 isec->sid = newsid; in selinux_inode_init_security()
3054 isec->sid = context_isec->sid; in selinux_inode_init_security_anon()
3058 &selinux_state, tsec->sid, tsec->sid, in selinux_inode_init_security_anon()
3059 isec->sclass, name, &isec->sid); in selinux_inode_init_security_anon()
3074 tsec->sid, in selinux_inode_init_security_anon()
3075 isec->sid, in selinux_inode_init_security_anon()
3135 u32 sid; in selinux_inode_follow_link() local
3141 sid = cred_sid(cred); in selinux_inode_follow_link()
3147 sid, isec->sid, isec->sclass, FILE__READ, &ad); in selinux_inode_follow_link()
3161 current_sid(), isec->sid, isec->sclass, perms, in audit_inode_permission()
3172 u32 sid; in selinux_inode_permission() local
3191 sid = cred_sid(cred); in selinux_inode_permission()
3197 sid, isec->sid, isec->sclass, perms, 0, in selinux_inode_permission()
3264 u32 newsid, sid = current_sid(); in selinux_inode_setxattr() local
3292 sid, isec->sid, isec->sclass, in selinux_inode_setxattr()
3333 sid, newsid, isec->sclass, in selinux_inode_setxattr()
3338 rc = security_validate_transition(&selinux_state, isec->sid, newsid, in selinux_inode_setxattr()
3339 sid, isec->sclass); in selinux_inode_setxattr()
3345 sbsec->sid, in selinux_inode_setxattr()
3386 isec->sid = newsid; in selinux_inode_post_setxattr()
3506 isec->sid, &context, in selinux_inode_getsecurity()
3509 error = security_sid_to_context(&selinux_state, isec->sid, in selinux_inode_getsecurity()
3548 isec->sid = newsid; in selinux_inode_setsecurity()
3569 *secid = isec->sid; in selinux_inode_getsecid()
3574 u32 sid; in selinux_inode_copy_up() local
3586 selinux_inode_getsecid(d_inode(src), &sid); in selinux_inode_copy_up()
3587 tsec->create_sid = sid; in selinux_inode_copy_up()
3649 rc = security_transition_sid(&selinux_state, tsec->sid, in selinux_kernfs_init_security()
3688 u32 sid = current_sid(); in selinux_file_permission() local
3695 if (sid == fsec->sid && fsec->isid == isec->sid && in selinux_file_permission()
3706 u32 sid = current_sid(); in selinux_file_alloc_security() local
3708 fsec->sid = sid; in selinux_file_alloc_security()
3709 fsec->fown_sid = sid; in selinux_file_alloc_security()
3736 if (ssid != fsec->sid) { in ioctl_has_perm()
3738 ssid, fsec->sid, in ioctl_has_perm()
3751 ssid, isec->sid, isec->sclass, in ioctl_has_perm()
3803 u32 sid = cred_sid(cred); in file_map_prot_check() local
3815 sid, sid, SECCLASS_PROCESS, in file_map_prot_check()
3844 u32 sid = current_sid(); in selinux_mmap_addr() local
3846 sid, sid, SECCLASS_MEMPROTECT, in selinux_mmap_addr()
3880 u32 sid = cred_sid(cred); in selinux_file_mprotect() local
3891 sid, sid, SECCLASS_PROCESS, in selinux_file_mprotect()
3898 sid, sid, SECCLASS_PROCESS, in selinux_file_mprotect()
3976 u32 sid = task_sid_obj(tsk); in selinux_file_send_sigiotask() local
3991 fsec->fown_sid, sid, in selinux_file_send_sigiotask()
4016 fsec->isid = isec->sid; in selinux_file_open()
4034 u32 sid = current_sid(); in selinux_task_alloc() local
4037 sid, sid, SECCLASS_PROCESS, PROCESS__FORK, NULL); in selinux_task_alloc()
4076 u32 sid = current_sid(); in selinux_kernel_act_as() local
4080 sid, secid, in selinux_kernel_act_as()
4085 tsec->sid = secid; in selinux_kernel_act_as()
4101 u32 sid = current_sid(); in selinux_kernel_create_files_as() local
4105 sid, isec->sid, in selinux_kernel_create_files_as()
4111 tsec->create_sid = isec->sid; in selinux_kernel_create_files_as()
4132 u32 sid = current_sid(); in selinux_kernel_module_from_file() local
4138 sid, sid, SECCLASS_SYSTEM, in selinux_kernel_module_from_file()
4147 if (sid != fsec->sid) { in selinux_kernel_module_from_file()
4149 sid, fsec->sid, SECCLASS_FD, FD__USE, &ad); in selinux_kernel_module_from_file()
4156 sid, isec->sid, SECCLASS_SYSTEM, in selinux_kernel_module_from_file()
4320 u32 sid = task_sid_obj(p); in selinux_task_to_inode() local
4324 isec->sid = sid; in selinux_task_to_inode()
4570 static int selinux_skb_peerlbl_sid(struct sk_buff *skb, u16 family, u32 *sid) in selinux_skb_peerlbl_sid() argument
4585 nlbl_type, xfrm_sid, sid); in selinux_skb_peerlbl_sid()
4631 return security_transition_sid(&selinux_state, tsec->sid, tsec->sid, in socket_sockcreate_sid()
4641 if (sksec->sid == SECINITSID_KERNEL) in sock_has_perm()
4649 current_sid(), sksec->sid, sksec->sclass, perms, in sock_has_perm()
4670 tsec->sid, newsid, secclass, SOCKET__CREATE, NULL); in selinux_socket_create()
4680 u32 sid = SECINITSID_KERNEL; in selinux_socket_post_create() local
4684 err = socket_sockcreate_sid(tsec, sclass, &sid); in selinux_socket_post_create()
4690 isec->sid = sid; in selinux_socket_post_create()
4696 sksec->sid = sid; in selinux_socket_post_create()
4713 sksec_a->peer_sid = sksec_b->sid; in selinux_socket_socketpair()
4714 sksec_b->peer_sid = sksec_a->sid; in selinux_socket_socketpair()
4744 u32 sid, node_perm; in selinux_socket_bind() local
4796 snum, &sid); in selinux_socket_bind()
4800 sksec->sid, sid, in selinux_socket_bind()
4830 err = sel_netnode_sid(addrp, family_sa, &sid); in selinux_socket_bind()
4840 sksec->sid, sid, in selinux_socket_bind()
4888 u32 sid, perm; in selinux_socket_connect_helper() local
4918 err = sel_netport_sid(sk->sk_protocol, snum, &sid); in selinux_socket_connect_helper()
4939 sksec->sid, sid, sksec->sclass, perm, &ad); in selinux_socket_connect_helper()
4972 u32 sid; in selinux_socket_accept() local
4981 sid = isec->sid; in selinux_socket_accept()
4986 newisec->sid = sid; in selinux_socket_accept()
5052 sksec_sock->sid, sksec_other->sid, in selinux_socket_unix_stream_connect()
5059 sksec_new->peer_sid = sksec_sock->sid; in selinux_socket_unix_stream_connect()
5060 err = security_sid_mls_copy(&selinux_state, sksec_other->sid, in selinux_socket_unix_stream_connect()
5061 sksec_sock->sid, &sksec_new->sid); in selinux_socket_unix_stream_connect()
5066 sksec_sock->peer_sid = sksec_new->sid; in selinux_socket_unix_stream_connect()
5084 ssec->sid, osec->sid, osec->sclass, SOCKET__SENDTO, in selinux_socket_unix_may_send()
5118 u32 sk_sid = sksec->sid; in selinux_sock_rcv_skb_compat()
5142 err = selinux_xfrm_sock_rcv_skb(sksec->sid, skb, &ad); in selinux_sock_rcv_skb_compat()
5152 u32 sk_sid = sksec->sid; in selinux_socket_sock_rcv_skb()
5271 peer_secid = isec->sid; in selinux_socket_getpeersec_dgram()
5291 sksec->sid = SECINITSID_UNLABELED; in selinux_sk_alloc_security()
5313 newsksec->sid = sksec->sid; in selinux_sk_clone_security()
5327 *secid = sksec->sid; in selinux_sk_getsecid()
5339 isec->sid = sksec->sid; in selinux_sock_graft()
5405 err = selinux_conn_sid(sksec->sid, peer_sid, &conn_sid); in selinux_sctp_assoc_request()
5510 newsksec->sid = asoc->secid; in selinux_sctp_sk_clone()
5528 err = selinux_conn_sid(sksec->sid, peersid, &connsid); in selinux_inet_conn_request()
5542 newsksec->sid = req->secid; in selinux_inet_csk_clone()
5566 static int selinux_secmark_relabel_packet(u32 sid) in selinux_secmark_relabel_packet() argument
5572 tsid = __tsec->sid; in selinux_secmark_relabel_packet()
5575 tsid, sid, SECCLASS_PACKET, PACKET__RELABELTO, in selinux_secmark_relabel_packet()
5602 tunsec->sid = current_sid(); in selinux_tun_dev_alloc_security()
5615 u32 sid = current_sid(); in selinux_tun_dev_create() local
5625 sid, sid, SECCLASS_TUN_SOCKET, TUN_SOCKET__CREATE, in selinux_tun_dev_create()
5634 current_sid(), tunsec->sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_attach_queue()
5650 sksec->sid = tunsec->sid; in selinux_tun_dev_attach()
5659 u32 sid = current_sid(); in selinux_tun_dev_open() local
5663 sid, tunsec->sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_open()
5668 sid, sid, SECCLASS_TUN_SOCKET, in selinux_tun_dev_open()
5672 tunsec->sid = sid; in selinux_tun_dev_open()
5742 u32 sid; in selinux_ip_output() local
5771 sid = sksec->sid; in selinux_ip_output()
5773 sid = SECINITSID_KERNEL; in selinux_ip_output()
5774 if (selinux_netlbl_skbuff_setsid(skb, state->pf, sid) != 0) in selinux_ip_output()
5804 sksec->sid, skb->secmark, in selinux_ip_postroute_compat()
5808 if (selinux_xfrm_postroute_last(sksec->sid, skb, &ad, proto)) in selinux_ip_postroute_compat()
5909 if (selinux_conn_sid(sksec->sid, skb_sid, &peer_sid)) in selinux_ip_postroute()
5916 peer_sid = sksec->sid; in selinux_ip_postroute()
6018 isec->sid = current_sid(); in ipc_init_security()
6026 u32 sid = current_sid(); in ipc_has_perm() local
6034 sid, isec->sid, isec->sclass, perms, &ad); in ipc_has_perm()
6042 msec->sid = SECINITSID_UNLABELED; in selinux_msg_msg_alloc_security()
6052 u32 sid = current_sid(); in selinux_msg_queue_alloc_security() local
6062 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_alloc_security()
6071 u32 sid = current_sid(); in selinux_msg_queue_associate() local
6079 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_associate()
6119 u32 sid = current_sid(); in selinux_msg_queue_msgsnd() local
6128 if (msec->sid == SECINITSID_UNLABELED) { in selinux_msg_queue_msgsnd()
6133 rc = security_transition_sid(&selinux_state, sid, isec->sid, in selinux_msg_queue_msgsnd()
6134 SECCLASS_MSG, NULL, &msec->sid); in selinux_msg_queue_msgsnd()
6144 sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_msgsnd()
6149 sid, msec->sid, SECCLASS_MSG, in selinux_msg_queue_msgsnd()
6154 msec->sid, isec->sid, SECCLASS_MSGQ, in selinux_msg_queue_msgsnd()
6167 u32 sid = task_sid_obj(target); in selinux_msg_queue_msgrcv() local
6177 sid, isec->sid, in selinux_msg_queue_msgrcv()
6181 sid, msec->sid, in selinux_msg_queue_msgrcv()
6191 u32 sid = current_sid(); in selinux_shm_alloc_security() local
6201 sid, isec->sid, SECCLASS_SHM, in selinux_shm_alloc_security()
6210 u32 sid = current_sid(); in selinux_shm_associate() local
6218 sid, isec->sid, SECCLASS_SHM, in selinux_shm_associate()
6276 u32 sid = current_sid(); in selinux_sem_alloc_security() local
6286 sid, isec->sid, SECCLASS_SEM, in selinux_sem_alloc_security()
6295 u32 sid = current_sid(); in selinux_sem_associate() local
6303 sid, isec->sid, SECCLASS_SEM, in selinux_sem_associate()
6384 *secid = isec->sid; in selinux_ipc_getsecid()
6397 u32 sid; in selinux_getprocattr() local
6406 current_sid(), __tsec->sid, in selinux_getprocattr()
6413 sid = __tsec->sid; in selinux_getprocattr()
6415 sid = __tsec->osid; in selinux_getprocattr()
6417 sid = __tsec->exec_sid; in selinux_getprocattr()
6419 sid = __tsec->create_sid; in selinux_getprocattr()
6421 sid = __tsec->keycreate_sid; in selinux_getprocattr()
6423 sid = __tsec->sockcreate_sid; in selinux_getprocattr()
6430 if (!sid) in selinux_getprocattr()
6433 error = security_sid_to_context(&selinux_state, sid, value, &len); in selinux_getprocattr()
6447 u32 mysid = current_sid(), sid = 0, ptsid; in selinux_setprocattr() local
6486 &sid, GFP_KERNEL); in selinux_setprocattr()
6511 value, size, &sid); in selinux_setprocattr()
6529 tsec->exec_sid = sid; in selinux_setprocattr()
6531 tsec->create_sid = sid; in selinux_setprocattr()
6533 if (sid) { in selinux_setprocattr()
6534 error = avc_has_perm(&selinux_state, mysid, sid, in selinux_setprocattr()
6539 tsec->keycreate_sid = sid; in selinux_setprocattr()
6541 tsec->sockcreate_sid = sid; in selinux_setprocattr()
6544 if (sid == 0) in selinux_setprocattr()
6551 tsec->sid, sid); in selinux_setprocattr()
6558 tsec->sid, sid, SECCLASS_PROCESS, in selinux_setprocattr()
6568 ptsid, sid, SECCLASS_PROCESS, in selinux_setprocattr()
6574 tsec->sid = sid; in selinux_setprocattr()
6663 ksec->sid = tsec->keycreate_sid; in selinux_key_alloc()
6665 ksec->sid = tsec->sid; in selinux_key_alloc()
6685 u32 perm, sid; in selinux_key_permission() local
6717 sid = cred_sid(cred); in selinux_key_permission()
6722 sid, ksec->sid, SECCLASS_KEY, perm, NULL); in selinux_key_permission()
6732 rc = security_sid_to_context(&selinux_state, ksec->sid, in selinux_key_getsecurity()
6744 u32 sid = current_sid(); in selinux_watch_key() local
6747 sid, ksec->sid, SECCLASS_KEY, KEY__VIEW, NULL); in selinux_watch_key()
6757 u32 sid = 0; in selinux_ib_pkey_access() local
6761 err = sel_ib_pkey_sid(subnet_prefix, pkey_val, &sid); in selinux_ib_pkey_access()
6770 sec->sid, sid, in selinux_ib_pkey_access()
6780 u32 sid = 0; in selinux_ib_endport_manage_subnet() local
6785 &sid); in selinux_ib_endport_manage_subnet()
6795 sec->sid, sid, in selinux_ib_endport_manage_subnet()
6807 sec->sid = current_sid(); in selinux_ib_alloc_security()
6823 u32 sid = current_sid(); in selinux_bpf() local
6829 sid, sid, SECCLASS_BPF, BPF__MAP_CREATE, in selinux_bpf()
6834 sid, sid, SECCLASS_BPF, BPF__PROG_LOAD, in selinux_bpf()
6864 static int bpf_fd_pass(struct file *file, u32 sid) in bpf_fd_pass() argument
6875 sid, bpfsec->sid, SECCLASS_BPF, in bpf_fd_pass()
6883 sid, bpfsec->sid, SECCLASS_BPF, in bpf_fd_pass()
6893 u32 sid = current_sid(); in selinux_bpf_map() local
6898 sid, bpfsec->sid, SECCLASS_BPF, in selinux_bpf_map()
6904 u32 sid = current_sid(); in selinux_bpf_prog() local
6909 sid, bpfsec->sid, SECCLASS_BPF, in selinux_bpf_prog()
6921 bpfsec->sid = current_sid(); in selinux_bpf_map_alloc()
6943 bpfsec->sid = current_sid(); in selinux_bpf_prog_alloc()
6970 u32 requested, sid = current_sid(); in selinux_perf_event_open() local
6983 return avc_has_perm(&selinux_state, sid, sid, SECCLASS_PERF_EVENT, in selinux_perf_event_open()
6995 perfsec->sid = current_sid(); in selinux_perf_event_alloc()
7012 u32 sid = current_sid(); in selinux_perf_event_read() local
7014 return avc_has_perm(&selinux_state, sid, perfsec->sid, in selinux_perf_event_read()
7021 u32 sid = current_sid(); in selinux_perf_event_write() local
7023 return avc_has_perm(&selinux_state, sid, perfsec->sid, in selinux_perf_event_write()
7050 int sid = current_sid(); in selinux_uring_sqpoll() local
7052 return avc_has_perm(&selinux_state, sid, sid, in selinux_uring_sqpoll()