Home
last modified time | relevance | path

Searched refs:cred (Results 1 – 25 of 256) sorted by relevance

1234567891011

/linux/net/sunrpc/
H A Dauth.c41 static struct cred machine_cred = {
49 const struct cred *rpc_machine_cred(void) in rpc_machine_cred()
261 rpcauth_unhash_cred_locked(struct rpc_cred *cred) in rpcauth_unhash_cred_locked() argument
263 if (!test_and_clear_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags)) in rpcauth_unhash_cred_locked()
265 hlist_del_rcu(&cred->cr_hash); in rpcauth_unhash_cred_locked()
270 rpcauth_unhash_cred(struct rpc_cred *cred) in rpcauth_unhash_cred() argument
275 if (!test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags)) in rpcauth_unhash_cred()
277 cache_lock = &cred->cr_auth->au_credcache->lock; in rpcauth_unhash_cred()
279 ret = rpcauth_unhash_cred_locked(cred); in rpcauth_unhash_cred()
312 rpcauth_stringify_acceptor(struct rpc_cred *cred) in rpcauth_stringify_acceptor() argument
[all …]
H A Dauth_unix.c71 unx_destroy_cred(struct rpc_cred *cred) in unx_destroy_cred() argument
73 call_rcu(&cred->cr_rcu, unx_free_cred_callback); in unx_destroy_cred()
80 unx_match(struct auth_cred *acred, struct rpc_cred *cred, int flags) in unx_match() argument
85 if (cred->cr_cred == acred->cred) in unx_match()
88 …if (!uid_eq(cred->cr_cred->fsuid, acred->cred->fsuid) || !gid_eq(cred->cr_cred->fsgid, acred->cred in unx_match()
91 if (acred->cred->group_info != NULL) in unx_match()
92 groups = acred->cred->group_info->ngroups; in unx_match()
95 if (cred->cr_cred->group_info == NULL) in unx_match()
97 if (groups != cred->cr_cred->group_info->ngroups) in unx_match()
101 if (!gid_eq(cred->cr_cred->group_info->gid[i], acred->cred->group_info->gid[i])) in unx_match()
[all …]
/linux/kernel/
H A Dcred.c11 #include <linux/cred.h>
43 struct cred *cred = container_of(rcu, struct cred, rcu); in put_cred_rcu() local
45 kdebug("put_cred_rcu(%p)", cred); in put_cred_rcu()
47 if (atomic_long_read(&cred->usage) != 0) in put_cred_rcu()
49 cred, atomic_long_read(&cred->usage)); in put_cred_rcu()
51 security_cred_free(cred); in put_cred_rcu()
52 key_put(cred in put_cred_rcu()
71 __put_cred(struct cred * cred) __put_cred() argument
92 struct cred *real_cred, *cred; exit_creds() local
128 const struct cred *cred; get_task_cred() local
[all...]
H A Duid16.c66 const struct cred *cred = current_cred(); in SYSCALL_DEFINE3() local
70 ruid = high2lowuid(from_kuid_munged(cred->user_ns, cred->uid)); in SYSCALL_DEFINE3()
71 euid = high2lowuid(from_kuid_munged(cred->user_ns, cred->euid)); in SYSCALL_DEFINE3()
72 suid = high2lowuid(from_kuid_munged(cred->user_ns, cred->suid)); in SYSCALL_DEFINE3()
89 const struct cred *cred = current_cred(); in SYSCALL_DEFINE3() local
93 rgid = high2lowgid(from_kgid_munged(cred->user_ns, cred->gid)); in SYSCALL_DEFINE3()
94 egid = high2lowgid(from_kgid_munged(cred->user_ns, cred->egid)); in SYSCALL_DEFINE3()
95 sgid = high2lowgid(from_kgid_munged(cred->user_ns, cred->sgid)); in SYSCALL_DEFINE3()
156 const struct cred *cred = current_cred(); in SYSCALL_DEFINE2() local
162 i = cred->group_info->ngroups; in SYSCALL_DEFINE2()
[all …]
H A Dgroups.c118 void set_groups(struct cred *new, struct group_info *group_info) in set_groups()
136 struct cred *new; in set_current_groups()
137 const struct cred *old; in set_current_groups()
163 const struct cred *cred = current_cred(); in SYSCALL_DEFINE2() local
170 i = cred->group_info->ngroups; in SYSCALL_DEFINE2()
176 if (groups_to_user(grouplist, cred->group_info)) { in SYSCALL_DEFINE2()
229 const struct cred *cred = current_cred(); in in_group_p() local
232 if (!gid_eq(grp, cred->fsgid)) in in_group_p()
233 retval = groups_search(cred->group_info, grp); in in_group_p()
241 const struct cred *cred = current_cred(); in in_egroup_p() local
[all …]
/linux/security/keys/
H A Dprocess_keys.c77 const struct cred *cred = current_cred(); in look_up_user_keyrings() local
82 uid_t uid = from_kuid(user_ns, cred->user->uid); in look_up_user_keyrings()
106 uid_keyring = keyring_alloc(buf, cred->user->uid, INVALID_GID, in look_up_user_keyrings()
107 cred, user_keyring_perm, in look_up_user_keyrings()
128 session_keyring = keyring_alloc(buf, cred->user->uid, INVALID_GID, in look_up_user_keyrings()
129 cred, user_keyring_perm, in look_up_user_keyrings()
185 struct key *get_user_session_keyring_rcu(const struct cred *cred) in get_user_session_keyring_rcu() argument
187 struct key *reg_keyring = READ_ONCE(cred->user_ns->user_keyring_register); in get_user_session_keyring_rcu()
194 .cred = cred, in get_user_session_keyring_rcu()
205 from_kuid(cred->user_ns, in get_user_session_keyring_rcu()
[all …]
H A Drequest_key_auth.c112 if (rka->cred) in free_request_key_auth()
113 put_cred(rka->cred); in free_request_key_auth()
166 const struct cred *cred = current_cred(); in request_key_auth_new() local
185 if (cred->request_key_auth) { in request_key_auth_new()
187 down_read(&cred->request_key_auth->sem); in request_key_auth_new()
192 &cred->request_key_auth->flags)) { in request_key_auth_new()
193 up_read(&cred->request_key_auth->sem); in request_key_auth_new()
198 irka = cred->request_key_auth->payload.data[0]; in request_key_auth_new()
199 rka->cred = get_cred(irka->cred); in request_key_auth_new()
202 up_read(&cred->request_key_auth->sem); in request_key_auth_new()
[all …]
H A Drequest_key.c80 static int umh_keys_init(struct subprocess_info *info, struct cred *cred) in umh_keys_init() argument
84 return install_session_keyring_to_cred(cred, keyring); in umh_keys_init()
122 const struct cred *cred = current_cred(); in call_sbin_request_key() local
139 cred = get_current_cred(); in call_sbin_request_key()
140 keyring = keyring_alloc(desc, cred->fsuid, cred->fsgid, cred, in call_sbin_request_key()
143 put_cred(cred); in call_sbin_request_key()
155 sprintf(uid_str, "%d", from_kuid(&init_user_ns, cred->fsuid)); in call_sbin_request_key()
156 sprintf(gid_str, "%d", from_kgid(&init_user_ns, cred->fsgid)); in call_sbin_request_key()
163 cred->thread_keyring ? cred->thread_keyring->serial : 0); in call_sbin_request_key()
166 if (cred->process_keyring) in call_sbin_request_key()
[all …]
/linux/security/apparmor/include/
H A Dcred.h22 static inline struct aa_label *cred_label(const struct cred *cred) in cred_label() argument
24 struct aa_label **blob = cred->security + apparmor_blob_sizes.lbs_cred; in cred_label()
30 static inline void set_cred_label(const struct cred *cred, in set_cred_label() argument
33 struct aa_label **blob = cred->security + apparmor_blob_sizes.lbs_cred; in set_cred_label()
45 static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred) in aa_get_newest_cred_label() argument
47 return aa_get_newest_label(cred_label(cred)); in aa_get_newest_cred_label()
50 static inline struct aa_label *aa_get_newest_cred_label_condref(const struct cred *cred, in aa_get_newest_cred_label_condref() argument
53 struct aa_label *l = cred_label(cred); in aa_get_newest_cred_label_condref()
149 static inline struct aa_label *__begin_cred_crit_section(const struct cred *cred, in __begin_cred_crit_section() argument
152 struct aa_label *label = cred_label(cred); in __begin_cred_crit_section()
H A Dmount.h28 int aa_remount(const struct cred *subj_cred,
32 int aa_bind_mount(const struct cred *subj_cred,
37 int aa_mount_change_type(const struct cred *subj_cred,
41 int aa_move_mount_old(const struct cred *subj_cred,
44 int aa_move_mount(const struct cred *subj_cred,
48 int aa_new_mount(const struct cred *subj_cred,
53 int aa_umount(const struct cred *subj_cred,
56 int aa_pivotroot(const struct cred *subj_cred,
/linux/include/linux/sunrpc/
H A Dsvcauth.h37 static inline void init_svc_cred(struct svc_cred *cred) in init_svc_cred() argument
39 cred->cr_group_info = NULL; in init_svc_cred()
40 cred->cr_raw_principal = NULL; in init_svc_cred()
41 cred->cr_principal = NULL; in init_svc_cred()
42 cred->cr_targ_princ = NULL; in init_svc_cred()
43 cred->cr_gss_mech = NULL; in init_svc_cred()
46 static inline void free_svc_cred(struct svc_cred *cred) in free_svc_cred() argument
48 if (cred->cr_group_info) in free_svc_cred()
49 put_group_info(cred->cr_group_info); in free_svc_cred()
50 kfree(cred->cr_raw_principal); in free_svc_cred()
[all …]
/linux/Documentation/translations/zh_CN/security/
H A Dcredentials.rst213 在Linux中,一个任务的所有凭据都保存在一个引用计数结构体‘struct cred’中,
215 task_struct中通过一个名为‘cred’的指针指向其凭据。
232 要更改cred结构体中的任何内容,必须遵循复制和替换的原则。首先进行复制,然后修
264 const struct cred *current_cred()
290 const struct cred *get_current_cred(void);
292 以及用于获取对一个实际上不存在于struct cred中的凭据的引用的函数::
311 const struct cred *__task_cred(struct task_struct *task);
317 const struct cred *tcred;
331 const struct cred *get_task_cred(struct task_struct *task);
358 这里的‘member’是cred结构体的非指针成员。例如::
[all …]
/linux/security/
H A Dcommoncap.c58 * @cred: The credentials to use
68 static inline int cap_capable_helper(const struct cred *cred, in cap_capable_helper() argument
75 /* See if cred has the capability in the target user namespace in cap_capable_helper()
82 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; in cap_capable_helper()
95 if ((ns->parent == cred_ns) && uid_eq(ns->owner, cred->euid)) in cap_capable_helper()
110 * @cred: The credentials to use
124 int cap_capable(const struct cred *cred, struct user_namespace *target_ns, in cap_capable() argument
127 const struct user_namespace *cred_ns = cred in cap_capable()
167 const struct cred *cred, *child_cred; cap_ptrace_access_check() local
204 const struct cred *cred, *child_cred; cap_ptrace_traceme() local
233 const struct cred *cred; cap_capget() local
807 __is_real(kuid_t uid,struct cred * cred) __is_real() argument
810 __is_eff(kuid_t uid,struct cred * cred) __is_eff() argument
813 __is_suid(kuid_t uid,struct cred * cred) __is_suid() argument
864 __cap_grew(target,source,cred) global() argument
866 __cap_full(field,cred) global() argument
[all...]
/linux/include/linux/pds/
H A Dpds_intr.h130 u32 cred, u32 flags) in pds_core_intr_credits() argument
132 if (WARN_ON_ONCE(cred > PDS_CORE_INTR_CRED_COUNT)) { in pds_core_intr_credits()
133 cred = ioread32(&intr_ctrl->credits); in pds_core_intr_credits()
134 cred &= PDS_CORE_INTR_CRED_COUNT_SIGNED; in pds_core_intr_credits()
137 iowrite32(cred | flags, &intr_ctrl->credits); in pds_core_intr_credits()
143 u32 cred; in pds_core_intr_clean_flags() local
145 cred = ioread32(&intr_ctrl->credits); in pds_core_intr_clean_flags()
146 cred &= PDS_CORE_INTR_CRED_COUNT_SIGNED; in pds_core_intr_clean_flags()
147 cred |= flags; in pds_core_intr_clean_flags()
148 iowrite32(cred, &intr_ctrl->credits); in pds_core_intr_clean_flags()
/linux/include/linux/
H A Dlsm_hook_defs.h29 LSM_HOOK(int, 0, binder_set_context_mgr, const struct cred *mgr)
30 LSM_HOOK(int, 0, binder_transaction, const struct cred *from,
31 const struct cred *to)
32 LSM_HOOK(int, 0, binder_transfer_binder, const struct cred *from,
33 const struct cred *to)
34 LSM_HOOK(int, 0, binder_transfer_file, const struct cred *from,
35 const struct cred *to, const struct file *file)
41 LSM_HOOK(int, 0, capset, struct cred *new, const struct cred *old,
44 LSM_HOOK(int, 0, capable, const struct cred *cred, struct user_namespace *ns,
88 const struct qstr *name, const struct cred *old, struct cred *new)
[all …]
H A Dnsproxy.h58 const struct cred *cred; member
61 static inline struct cred *nsset_cred(struct nsset *set) in nsset_cred()
64 return (struct cred *)set->cred; in nsset_cred()
96 void switch_cred_namespaces(const struct cred *old, const struct cred *new);
104 struct cred *, struct fs_struct *);
/linux/fs/nfs/
H A Dnfs4state.c114 int nfs4_init_clientid(struct nfs_client *clp, const struct cred *cred) in nfs4_init_clientid() argument
130 status = nfs4_proc_setclientid(clp, NFS4_CALLBACK, port, cred, &clid); in nfs4_init_clientid()
137 status = nfs4_proc_setclientid_confirm(clp, &clid, cred); in nfs4_init_clientid()
146 const struct cred *nfs4_get_machine_cred(struct nfs_client *clp) in nfs4_get_machine_cred()
159 static const struct cred *
162 const struct cred *cred = NULL; in nfs4_get_renew_cred_server_locked() local
172 cred = get_cred(sp->so_cred); in nfs4_get_renew_cred_server_locked()
175 return cred; in nfs4_get_renew_cred_server_locked()
185 const struct cred *nfs4_get_renew_cred(struct nfs_client *clp) in nfs4_get_renew_cred()
187 const struct cred *cred = NULL; in nfs4_get_renew_cred() local
[all …]
/linux/fs/fuse/
H A Dpassthrough.c36 .cred = ff->cred, in fuse_passthrough_read_iter()
63 .cred = ff->cred, in fuse_passthrough_write_iter()
88 .cred = ff->cred, in fuse_passthrough_splice_read()
114 .cred = ff->cred, in fuse_passthrough_splice_write()
137 .cred = ff->cred, in fuse_passthrough_mmap()
171 &fb->file->f_path, fb->cred); in fuse_passthrough_open()
180 ff->cred = get_cred(fb->cred); in fuse_passthrough_open()
195 put_cred(ff->cred); in fuse_passthrough_release()
196 ff->cred = NULL; in fuse_passthrough_release()
/linux/drivers/net/ethernet/pensando/ionic/
H A Dionic_regs.h66 int intr_idx, u32 cred, u32 flags) in ionic_intr_credits() argument
68 if (WARN_ON_ONCE(cred > IONIC_INTR_CRED_COUNT)) { in ionic_intr_credits()
69 cred = ioread32(&intr_ctrl[intr_idx].credits); in ionic_intr_credits()
70 cred &= IONIC_INTR_CRED_COUNT_SIGNED; in ionic_intr_credits()
73 iowrite32(cred | flags, &intr_ctrl[intr_idx].credits); in ionic_intr_credits()
79 u32 cred; in ionic_intr_clean() local
81 cred = ioread32(&intr_ctrl[intr_idx].credits); in ionic_intr_clean()
82 cred &= IONIC_INTR_CRED_COUNT_SIGNED; in ionic_intr_clean()
83 cred |= IONIC_INTR_CRED_RESET_COALESCE; in ionic_intr_clean()
84 iowrite32(cred, &intr_ctrl[intr_idx].credits); in ionic_intr_clean()
/linux/include/trace/events/
H A Dcapability.h28 TP_PROTO(const struct cred *cred, struct user_namespace *target_ns,
31 TP_ARGS(cred, target_ns, capable_ns, cap, ret),
34 __field(const struct cred *, cred)
42 __entry->cred = cred;
50 __entry->cred, __entry->target_ns, __entry->capable_ns, __entry->cap,
/linux/net/sunrpc/auth_gss/
H A Dauth_gss.c135 gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx) in gss_cred_set_ctx() argument
137 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base); in gss_cred_set_ctx()
139 if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) in gss_cred_set_ctx()
143 set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); in gss_cred_set_ctx()
145 clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); in gss_cred_set_ctx()
149 gss_cred_get_ctx(struct rpc_cred *cred) in gss_cred_get_ctx() argument
151 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base); in gss_cred_get_ctx()
408 const struct cred *cred) in gss_encode_v0_msg() argument
410 struct user_namespace *userns = cred->user_ns; in gss_encode_v0_msg()
435 const struct cred *cred) in gss_encode_v1_msg() argument
[all …]
/linux/security/landlock/
H A Dcred.c11 #include <linux/cred.h>
15 #include "cred.h"
19 static void hook_cred_transfer(struct cred *const new, in hook_cred_transfer()
20 const struct cred *const old) in hook_cred_transfer()
31 static int hook_cred_prepare(struct cred *const new, in hook_cred_prepare()
32 const struct cred *const old, const gfp_t gfp) in hook_cred_prepare()
38 static void hook_cred_free(struct cred *const cred) in hook_cred_free()
40 struct landlock_ruleset *const dom = landlock_cred(cred)->domain; in hook_cred_free()
51 landlock_cred(bprm->cred) in landlock_add_cred_hooks()
35 hook_cred_free(struct cred * const cred) hook_cred_free() argument
[all...]
/linux/security/apparmor/
H A Dtask.c51 struct cred *new; in aa_replace_current_label()
121 struct cred *new; in aa_set_current_hat()
161 struct cred *new; in aa_restore_previous_label()
227 static int profile_ptrace_perm(const struct cred *cred, in profile_ptrace_perm() argument
235 ad->subj_cred = cred; in profile_ptrace_perm()
243 static int profile_tracee_perm(const struct cred *cred, in profile_tracee_perm() argument
252 return profile_ptrace_perm(cred, tracee, tracer, request, ad); in profile_tracee_perm()
255 static int profile_tracer_perm(const struct cred *cred, in profile_tracer_perm() argument
264 return profile_ptrace_perm(cred, tracer, tracee, request, ad); in profile_tracer_perm()
273 ad->error = aa_capable(cred, &tracer->label, CAP_SYS_PTRACE, in profile_tracer_perm()
[all …]
/linux/security/safesetid/
H A Dlsm.c91 static int safesetid_security_capable(const struct cred *cred, in safesetid_security_capable() argument
114 if (setid_policy_lookup((kid_t){.uid = cred->uid}, INVALID_ID, UID) == SIDPOL_DEFAULT) in safesetid_security_capable()
121 __kuid_val(cred->uid)); in safesetid_security_capable()
128 if (setid_policy_lookup((kid_t){.gid = cred->gid}, INVALID_ID, GID) == SIDPOL_DEFAULT) in safesetid_security_capable()
135 __kgid_val(cred->gid)); in safesetid_security_capable()
148 static bool id_permitted_for_cred(const struct cred *old, kid_t new_id, enum setid_type new_type) in id_permitted_for_cred()
191 static int safesetid_task_fix_setuid(struct cred *new, in safesetid_task_fix_setuid()
192 const struct cred *old, in safesetid_task_fix_setuid()
215 static int safesetid_task_fix_setgid(struct cred *new, in safesetid_task_fix_setgid()
216 const struct cred *old, in safesetid_task_fix_setgid()
[all …]
/linux/fs/nfsd/
H A Dauth.c8 int nfsexp_flags(struct svc_cred *cred, struct svc_export *exp) in nfsexp_flags() argument
14 if (f->pseudoflavor == cred->cr_flavor) in nfsexp_flags()
21 int nfsd_setuser(struct svc_cred *cred, struct svc_export *exp) in nfsd_setuser() argument
25 struct cred *new; in nfsd_setuser()
27 int flags = nfsexp_flags(cred, exp); in nfsd_setuser()
35 new->fsuid = cred->cr_uid; in nfsd_setuser()
36 new->fsgid = cred->cr_gid; in nfsd_setuser()
38 rqgi = cred->cr_group_info; in nfsd_setuser()

1234567891011