Lines Matching defs:cred

216 	struct cred *cred = (struct cred *) current->real_cred;
219 tsec = selinux_cred(cred);
226 static inline u32 cred_sid(const struct cred *cred)
230 tsec = selinux_cred(cred);
413 const struct cred *cred)
415 const struct task_security_struct *tsec = selinux_cred(cred);
432 const struct cred *cred)
434 const struct task_security_struct *tsec = selinux_cred(cred);
603 const struct cred *cred = current_cred();
759 rc = may_context_mount_sb_relabel(fscontext_sid, sbsec, cred);
779 cred);
785 cred);
798 cred);
817 sbsec, cred);
1600 static int cred_has_capability(const struct cred *cred,
1606 u32 sid = cred_sid(cred);
1640 static int inode_has_perm(const struct cred *cred,
1648 validate_creds(cred);
1653 sid = cred_sid(cred);
1663 static inline int dentry_has_perm(const struct cred *cred,
1673 return inode_has_perm(cred, inode, av, &ad);
1679 static inline int path_has_perm(const struct cred *cred,
1689 return inode_has_perm(cred, inode, av, &ad);
1693 static inline int file_path_has_perm(const struct cred *cred,
1701 return inode_has_perm(cred, file_inode(file), av, &ad);
1716 static int file_has_perm(const struct cred *cred,
1723 u32 sid = cred_sid(cred);
1740 rc = bpf_fd_pass(file, cred_sid(cred));
1748 rc = inode_has_perm(cred, inode, av, &ad);
1935 static int superblock_has_perm(const struct cred *cred,
1941 u32 sid = cred_sid(cred);
2017 static int selinux_binder_set_context_mgr(const struct cred *mgr)
2024 static int selinux_binder_transaction(const struct cred *from,
2025 const struct cred *to)
2044 static int selinux_binder_transfer_binder(const struct cred *from,
2045 const struct cred *to)
2053 static int selinux_binder_transfer_file(const struct cred *from,
2054 const struct cred *to,
2121 static int selinux_capset(struct cred *new, const struct cred *old,
2141 static int selinux_capable(const struct cred *cred, struct user_namespace *ns,
2144 return cred_has_capability(cred, cap, opts, ns == &init_user_ns);
2149 const struct cred *cred = current_cred();
2164 rc = superblock_has_perm(cred, sb, FILESYSTEM__QUOTAMOD, NULL);
2173 rc = superblock_has_perm(cred, sb, FILESYSTEM__QUOTAGET, NULL);
2184 const struct cred *cred = current_cred();
2186 return dentry_has_perm(cred, dentry, FILE__QUOTAON);
2315 new_tsec = selinux_cred(bprm->cred);
2422 static inline void flush_unauthorized_files(const struct cred *cred,
2444 if (file_path_has_perm(cred, file, FILE__READ | FILE__WRITE))
2455 n = iterate_fd(files, 0, match_file, cred);
2459 devnull = dentry_open(&selinux_null, O_RDWR, cred);
2465 } while ((n = iterate_fd(files, n, match_file, cred)) != 0);
2479 new_tsec = selinux_cred(bprm->cred);
2484 flush_unauthorized_files(bprm->cred, current->files);
2718 const struct cred *cred = current_cred();
2723 return superblock_has_perm(cred, sb, FILESYSTEM__MOUNT, &ad);
2728 const struct cred *cred = current_cred();
2733 return superblock_has_perm(cred, dentry->d_sb, FILESYSTEM__GETATTR, &ad);
2742 const struct cred *cred = current_cred();
2745 return superblock_has_perm(cred, path->dentry->d_sb,
2748 return path_has_perm(cred, path, FILE__MOUNTON);
2754 const struct cred *cred = current_cred();
2756 return path_has_perm(cred, to_path, FILE__MOUNTON);
2761 const struct cred *cred = current_cred();
2763 return superblock_has_perm(cred, mnt->mnt_sb,
2874 const struct cred *old,
2875 struct cred *new)
2984 const struct cred *cred = current_cred();
2986 return dentry_has_perm(cred, dentry, FILE__READ);
2992 const struct cred *cred = current_cred();
2997 validate_creds(cred);
3001 sid = cred_sid(cred);
3032 const struct cred *cred = current_cred();
3049 validate_creds(cred);
3056 sid = cred_sid(cred);
3083 const struct cred *cred = current_cred();
3098 return dentry_has_perm(cred, dentry, FILE__SETATTR);
3106 return dentry_has_perm(cred, dentry, av);
3116 const struct cred *cred = current_cred();
3119 if (cap_capable(cred, &init_user_ns, CAP_MAC_ADMIN, opts))
3121 if (cred_has_capability(cred, CAP_MAC_ADMIN, opts, true))
3262 const struct cred *cred = current_cred();
3264 return dentry_has_perm(cred, dentry, FILE__GETATTR);
3269 const struct cred *cred = current_cred();
3271 return dentry_has_perm(cred, dentry, FILE__GETATTR);
3435 static int selinux_inode_copy_up(struct dentry *src, struct cred **new)
3439 struct cred *new_creds = *new;
3535 const struct cred *cred = current_cred();
3542 return file_has_perm(cred, file,
3581 static int ioctl_has_perm(const struct cred *cred, struct file *file,
3589 u32 ssid = cred_sid(cred);
3623 const struct cred *cred = current_cred();
3632 error = file_has_perm(cred, file, FILE__GETATTR);
3637 error = file_has_perm(cred, file, FILE__SETATTR);
3643 error = file_has_perm(cred, file, 0);
3648 error = cred_has_capability(cred, CAP_SYS_TTY_CONFIG,
3655 error = ioctl_has_perm(cred, file, FILE__IOCTL, (u16) cmd);
3662 error = ioctl_has_perm(cred, file, FILE__IOCTL, (u16) cmd);
3698 const struct cred *cred = current_cred();
3699 u32 sid = cred_sid(cred);
3728 return file_has_perm(cred, file, av);
3775 const struct cred *cred = current_cred();
3776 u32 sid = cred_sid(cred);
3804 rc = file_has_perm(cred, vma->vm_file, FILE__EXECMOD);
3815 const struct cred *cred = current_cred();
3817 return file_has_perm(cred, file, FILE__LOCK);
3823 const struct cred *cred = current_cred();
3829 err = file_has_perm(cred, file, FILE__WRITE);
3840 err = file_has_perm(cred, file, 0);
3853 err = file_has_perm(cred, file, FILE__LOCK);
3893 const struct cred *cred = current_cred();
3895 return file_has_perm(cred, file, file_to_av(file));
3939 static int selinux_cred_prepare(struct cred *new, const struct cred *old,
3952 static void selinux_cred_transfer(struct cred *new, const struct cred *old)
3960 static void selinux_cred_getsecid(const struct cred *c, u32 *secid)
3969 static int selinux_kernel_act_as(struct cred *new, u32 secid)
3993 static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode)
4134 static int selinux_task_prlimit(const struct cred *cred, const struct cred *tcred,
4146 cred_sid(cred), cred_sid(tcred),
4189 int sig, const struct cred *cred)
4198 if (!cred)
4201 secid = cred_sid(cred);
6389 struct cred *new;
6592 static int selinux_key_alloc(struct key *k, const struct cred *cred,
6602 tsec = selinux_cred(cred);
6621 const struct cred *cred,
6658 sid = cred_sid(cred);