/freebsd/sys/security/audit/ |
H A D | audit_syscalls.c | 74 if (jailed(td->td_ucred)) in sys_audit() 121 error = mac_system_check_audit(td->td_ucred, rec, uap->length); in sys_audit() 168 if (jailed(td->td_ucred)) in sys_auditon() 173 error = mac_system_check_auditon(td->td_ucred, uap->cmd); in sys_auditon() 595 if (jailed(td->td_ucred)) in sys_getauid() 600 return (copyout(&td->td_ucred->cr_audit.ai_auid, uap->auid, in sys_getauid() 601 sizeof(td->td_ucred->cr_audit.ai_auid))); in sys_getauid() 612 if (jailed(td->td_ucred)) in sys_setauid() 652 cred = td->td_ucred; in sys_getaudit() 677 if (jailed(td->td_ucred)) in sys_setaudit() [all …]
|
/freebsd/sys/kern/ |
H A D | kern_prot.c | 252 td->td_retval[0] = td->td_ucred->cr_ruid; in sys_getuid() 254 td->td_retval[1] = td->td_ucred->cr_uid; in sys_getuid() 269 td->td_retval[0] = td->td_ucred->cr_uid; in sys_geteuid() 283 td->td_retval[0] = td->td_ucred->cr_rgid; in sys_getgid() 285 td->td_retval[1] = td->td_ucred->cr_groups[0]; in sys_getgid() 305 td->td_retval[0] = td->td_ucred->cr_groups[0]; in sys_getegid() 321 cred = td->td_ucred; in sys_getgroups() 1239 cred = td->td_ucred; in sys_getresuid() 1266 cred = td->td_ucred; in sys_getresgid() 1596 return (cr_cansee(td->td_ucred, p->p_ucred)); in p_cansee() [all …]
|
H A D | kern_ctf.c | 115 0, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, in link_elf_ctf_get() 137 hdr->e_shoff, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, in link_elf_ctf_get() 163 UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, NULL, td)) != 0) in link_elf_ctf_get() 183 shdr[i].sh_offset, UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, in link_elf_ctf_get() 244 td->td_ucred, NOCRED, NULL, td)) != 0) in link_elf_ctf_get() 291 vn_close(nd.ni_vp, FREAD, td->td_ucred, td); in link_elf_ctf_get()
|
H A D | vfs_acl.c | 242 error = mac_vnode_check_setacl(td->td_ucred, vp, type, inkernelacl); in vacl_set_acl() 247 td->td_ucred, td); in vacl_set_acl() 273 error = mac_vnode_check_getacl(td->td_ucred, vp, type); in vacl_get_acl() 278 td->td_ucred, td); in vacl_get_acl() 306 error = mac_vnode_check_deleteacl(td->td_ucred, vp, type); in vacl_delete() 310 error = VOP_SETACL(vp, acl_type_unold(type), 0, td->td_ucred, td); in vacl_delete() 336 td->td_ucred, td); in vacl_aclcheck()
|
H A D | vfs_syscalls.c | 199 if (!prison_allow(td->td_ucred, PR_ALLOW_QUOTAS)) in sys_quotactl() 287 error = mac_mount_check_stat(td->td_ucred, mp); in kern_do_statfs() 294 if (priv_check_cred_vfs_generation(td->td_ucred)) { in kern_do_statfs() 296 prison_enforce_statfs(td->td_ucred, mp, buf); in kern_do_statfs() 472 if (prison_canseemount(td->td_ucred, mp) != 0) { in kern_getfsstat() 477 if (mac_mount_check_stat(td->td_ucred, mp) != 0) { in kern_getfsstat() 502 if (prison_canseemount(td->td_ucred, mp) != 0) { in kern_getfsstat() 507 if (mac_mount_check_stat(td->td_ucred, mp) != 0) { in kern_getfsstat() 545 if (priv_check_cred_vfs_generation(td->td_ucred)) { in kern_getfsstat() 550 prison_enforce_statfs(td->td_ucred, mp, sptmp); in kern_getfsstat() [all …]
|
H A D | kern_acct.c | 221 error = mac_system_check_acct(td->td_ucred, nd.ni_vp); in sys_acct() 224 vn_close(nd.ni_vp, flags, td->td_ucred, td); in sys_acct() 230 vn_close(nd.ni_vp, flags, td->td_ucred, td); in sys_acct() 235 error = mac_system_check_acct(td->td_ucred, NULL); in sys_acct() 277 acct_cred = crhold(td->td_ucred); in sys_acct()
|
H A D | vfs_extattr.c | 202 error = mac_vnode_check_setextattr(td->td_ucred, vp, attrnamespace, in extattr_set_vp() 209 td->td_ucred, td); in extattr_set_vp() 388 error = mac_vnode_check_getextattr(td->td_ucred, vp, attrnamespace, in extattr_get_vp() 395 td->td_ucred, td); in extattr_get_vp() 548 error = mac_vnode_check_deleteextattr(td->td_ucred, vp, attrnamespace, in extattr_delete_vp() 554 error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, td->td_ucred, in extattr_delete_vp() 558 td->td_ucred, td); in extattr_delete_vp() 705 error = mac_vnode_check_listextattr(td->td_ucred, vp, attrnamespace); in extattr_list_vp() 713 td->td_ucred, td); in extattr_list_vp()
|
H A D | uipc_sem.c | 281 pr_path = curthread->td_ucred->cr_prison->pr_path; in ksem_fill_kinfo() 505 ks = ksem_alloc(td->td_ucred, mode, value); in ksem_create() 512 pr_path = td->td_ucred->cr_prison->pr_path; in ksem_create() 537 ks = ksem_alloc(td->td_ucred, mode, value); in ksem_create() 556 error = mac_posixsem_check_open(td->td_ucred, in ksem_create() 560 error = ksem_access(ks, td->td_ucred); in ksem_create() 664 pr_path = td->td_ucred->cr_prison->pr_path; in sys_ksem_unlink() 677 error = ksem_remove(path, fnv, td->td_ucred); in sys_ksem_unlink() 733 error = mac_posixsem_check_post(td->td_ucred, fp->f_cred, ks); in sys_ksem_post() 827 error = mac_posixsem_check_wait(td->td_ucred, fp->f_cred, ks); in kern_sem_wait() [all …]
|
H A D | uipc_syscalls.c | 159 error = mac_socket_check_create(td->td_ucred, domain, type, protocol); in kern_socket() 167 error = socreate(domain, &so, type, protocol, td->td_ucred, td); in kern_socket() 173 (void) fo_ioctl(fp, FIONBIO, &fflag, td->td_ucred, td); in kern_socket() 221 error = mac_socket_check_bind(td->td_ucred, so, sa); in kern_bindat() 268 error = mac_socket_check_listen(td->td_ucred, so); in kern_listen() 349 error = mac_socket_check_accept(td->td_ucred, head); in kern_accept4() 387 (void) fo_ioctl(nfp, FIONBIO, &tmp, td->td_ucred, td); in kern_accept4() 389 (void) fo_ioctl(nfp, FIOASYNC, &tmp, td->td_ucred, td); in kern_accept4() 498 error = mac_socket_check_connect(td->td_ucred, so, sa); in kern_connectat() 565 error = mac_socket_check_create(td->td_ucred, domai in kern_socketpair() [all...] |
H A D | sysv_shm.c | 338 if (shm_find_prison(td->td_ucred) == NULL) in kern_shmdt_locked() 353 error = mac_sysvshm_check_shmdt(td->td_ucred, in kern_shmdt_locked() 394 rpr = shm_find_prison(td->td_ucred); in kern_shmat_locked() 414 error = mac_sysvshm_check_shmat(td->td_ucred, shmseg, shmflg); in kern_shmat_locked() 504 rpr = shm_find_prison(td->td_ucred); in kern_shmctl_locked() 545 error = mac_sysvshm_check_shmctl(td->td_ucred, shmseg, cmd); in kern_shmctl_locked() 557 if (td->td_ucred->cr_prison != shmseg->cred->cr_prison) in kern_shmctl_locked() 671 error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, shmflg); in shmget_existing() 684 struct ucred *cred = td->td_ucred; in shmget_allocate_segment() 786 if (shm_find_prison(td->td_ucred) == NULL) in sys_shmget() [all …]
|
H A D | sysv_msg.c | 502 rpr = msg_find_prison(td->td_ucred); in kern_msgctl() 537 error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd); in kern_msgctl() 566 error = mac_sysvmsq_check_msgrmid(td->td_ucred, msghdr); in kern_msgctl() 610 if (td->td_ucred->cr_prison != msqkptr->cred->cr_prison) in kern_msgctl() 647 struct ucred *cred = td->td_ucred; in sys_msgget() 778 rpr = msg_find_prison(td->td_ucred); in kern_msgsnd() 817 error = mac_sysvmsq_check_msqsnd(td->td_ucred, msqkptr); in kern_msgsnd() 965 mac_sysvmsg_create(td->td_ucred, msqkptr, msghdr); in kern_msgsnd() 1066 error = mac_sysvmsq_check_msgmsq(td->td_ucred, msghdr, msqkptr); in kern_msgsnd() 1146 rpr = msg_find_prison(td->td_ucred); in kern_msgrcv() [all …]
|
/freebsd/sys/contrib/openzfs/module/os/freebsd/zfs/ |
H A D | zfs_file_os.c | 96 error = fo_truncate(fp, 0, td->td_ucred, td); in zfs_file_open() 140 rc = fo_write(fp, &auio, td->td_ucred, FOF_OFFSET, td); in zfs_file_write_impl() 194 rc = fo_read(fp, &auio, td->td_ucred, FOF_OFFSET, td); in zfs_file_read_impl() 247 rc = fo_stat(fp, &sb, td->td_ucred, td); in zfs_file_getattr() 249 rc = fo_stat(fp, &sb, td->td_ucred); in zfs_file_getattr() 304 td->td_ucred, td); in zfs_file_deallocate()
|
/freebsd/sys/compat/linux/ |
H A D | linux_ioctl.c | 176 (caddr_t)&mediasize, td->td_ucred, td); in linux_ioctl_hdio() 179 (caddr_t)§orsize, td->td_ucred, td); in linux_ioctl_hdio() 182 (caddr_t)&fwheads, td->td_ucred, td); in linux_ioctl_hdio() 185 (caddr_t)&fwsectors, td->td_ucred, td); in linux_ioctl_hdio() 254 (caddr_t)§orsize, td->td_ucred, td); in linux_ioctl_disk() 257 (caddr_t)&mediasize, td->td_ucred, td); in linux_ioctl_disk() 270 (caddr_t)&mediasize, td->td_ucred, td); in linux_ioctl_disk() 279 (caddr_t)§orsize, td->td_ucred, td); in linux_ioctl_disk() 288 (caddr_t)&stripesize, td->td_ucred, td); in linux_ioctl_disk() 297 (caddr_t)§orsize, td->td_ucred, td); in linux_ioctl_disk() [all …]
|
H A D | linux_mib.c | 496 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_get_osname() 507 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_set_osname() 520 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_get_osrelease() 532 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_kernver() 546 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_set_osrelease() 562 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_get_oss_version() 575 lpr = linux_find_prison(td->td_ucred->cr_prison, &pr); in linux_set_oss_version()
|
/freebsd/sys/contrib/openzfs/include/os/freebsd/spl/sys/ |
H A D | cred.h | 50 #define CRED() curthread->td_ucred 55 #define kcred (thread0.td_ucred)
|
/freebsd/sys/cddl/compat/opensolaris/sys/ |
H A D | cred.h | 39 #define CRED() (curthread->td_ucred) 44 #define kcred (thread0.td_ucred)
|
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/oformat/ |
H A D | tst.print.ksh | 27 print(*curthread->td_ucred); 28 print(*curthread->td_ucred->cr_prison);
|
/freebsd/sys/security/mac_veriexec_parser/ |
H A D | mac_veriexec_parser.c | 270 rc = VOP_GETATTR(nid.ni_vp, &va, curthread->td_ucred); in read_manifest() 281 curthread->td_ucred, NOCRED, &resid, curthread); in read_manifest() 291 (void)vn_close(nid.ni_vp, FREAD, curthread->td_ucred, curthread); in read_manifest() 352 rc = VOP_GETATTR(nid.ni_vp, &va, curthread->td_ucred); in parse_entry() 369 vn_close(nid.ni_vp, FREAD, curthread->td_ucred, curthread); in parse_entry()
|
/freebsd/sys/dev/veriexec/ |
H A D | verified_exec.c | 216 error = VOP_GETATTR(nid.ni_vp, &vattr, td->td_ucred); in verifiedexecioctl() 221 (void) vn_close(nid.ni_vp, FREAD, td->td_ucred, in verifiedexecioctl() 243 (void) vn_close(nid.ni_vp, FREAD, td->td_ucred, td); in verifiedexecioctl()
|
/freebsd/sys/rpc/ |
H A D | clnt_rc.c | 109 rc->rc_ucred = crdup(curthread->td_ucred); in clnt_reconnect_create() 166 oldcred = td->td_ucred; in clnt_reconnect_connect() 167 td->td_ucred = rc->rc_ucred; in clnt_reconnect_connect() 172 td->td_ucred = oldcred; in clnt_reconnect_connect() 195 td->td_ucred = oldcred; in clnt_reconnect_connect() 213 td->td_ucred = oldcred; in clnt_reconnect_connect() 227 td->td_ucred = oldcred; in clnt_reconnect_connect()
|
/freebsd/sys/nlm/ |
H A D | nlm_advlock.c | 249 cred = td->td_ucred; in nlm_advlock_internal() 250 td->td_ucred = vp->v_mount->mnt_cred; in nlm_advlock_internal() 251 crhold(td->td_ucred); in nlm_advlock_internal() 378 cred1 = td->td_ucred; in nlm_advlock_internal() 379 td->td_ucred = cred; in nlm_advlock_internal() 444 cred = crhold(td->td_ucred); in nlm_set_creds_for_lock() 447 td->td_ucred = cred; in nlm_set_creds_for_lock() 461 oldcred = td->td_ucred; in nlm_reclaim_free_lock() 467 crfree(td->td_ucred); in nlm_reclaim_free_lock() 468 td->td_ucred = oldcred; in nlm_reclaim_free_lock() [all …]
|
/freebsd/sys/security/mac_veriexec/ |
H A D | veriexec_fingerprint.c | 119 imgp->attr->va_gen, td->td_ucred->cr_ruid, imgp->proc->p_pid, in identify_error() 160 UIO_SYSSPACE, IO_NODELOCKED, td->td_ucred, NOCRED, &resid, in evaluate_fingerprint() 299 mac_priv_grant(td->td_ucred, PRIV_VERIEXEC_DIRECT) != 0) { in mac_veriexec_fingerprint_check_image() 342 mac_priv_grant(td->td_ucred, PRIV_VERIEXEC_NOVERIFY) == 0) { in mac_veriexec_fingerprint_check_image()
|
/freebsd/sys/fs/devfs/ |
H A D | devfs_vfsops.c | 83 injail = jailed(td->td_ucred); in devfs_mount() 101 rsnum != td->td_ucred->cr_prison->pr_devfs_rsnum) in devfs_mount() 107 rsnum = td->td_ucred->cr_prison->pr_devfs_rsnum; in devfs_mount()
|
/freebsd/sys/netinet6/ |
H A D | udp6_usrreq.c | 642 error = cr_canseesocket(req->td->td_ucred, in udp6_getcred() 785 inp->in6p_outputopts, td->td_ucred, nxt)) != 0) { in udp6_send() 820 td->td_ucred, scope_ambiguous, &in6a, NULL); in udp6_send() 832 error = in6_pcbsetport(laddr, inp, td->td_ucred); in udp6_send() 1061 error = in_pcbbind(inp, &sin, td->td_ucred); in udp6_bind() 1067 error = in6_pcbbind(inp, sin6_p, td->td_ucred); in udp6_bind() 1146 error = prison_remote_ip4(td->td_ucred, &sin.sin_addr); in udp6_connect() 1154 error = in_pcbconnect(inp, &sin, td->td_ucred); in udp6_connect() 1179 error = prison_remote_ip6(td->td_ucred, &sin6->sin6_addr); in udp6_connect() 1187 error = in6_pcbconnect(inp, sin6, td->td_ucred, true); in udp6_connect()
|
/freebsd/sys/ufs/ufs/ |
H A D | ufs_vfsops.c | 97 id = td->td_ucred->cr_ruid; in ufs_quotactl() 101 id = td->td_ucred->cr_rgid; in ufs_quotactl()
|