Home
last modified time | relevance | path

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

12345678910>>...13

/linux/include/linux/
H A Dcred.h20 struct cred;
66 extern void set_groups(struct cred *, struct group_info *);
111 struct cred { struct
149 extern void __put_cred(struct cred *); argument
152 extern const struct cred *get_task_cred(struct task_struct *);
153 extern struct cred *cred_alloc_blank(void);
154 extern struct cred *prepare_creds(void);
155 extern struct cred *prepare_exec_creds(void);
156 extern int commit_creds(struct cred *);
157 extern void abort_creds(struct cred *);
[all …]
H A Dsecurity.h43 struct cred;
174 extern int cap_capable(const struct cred *cred, struct user_namespace *ns,
181 extern int cap_capset(struct cred *new, const struct cred *old,
196 extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags);
332 int security_binder_set_context_mgr(const struct cred *mgr);
333 int security_binder_transaction(const struct cred *from,
334 const struct cred *to);
335 int security_binder_transfer_binder(const struct cred *from,
336 const struct cred *to);
337 int security_binder_transfer_file(const struct cred *from,
[all …]
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 …]
/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.c44 struct cred init_cred = {
70 struct cred *cred = container_of(rcu, struct cred, rcu); in put_cred_rcu() local
72 kdebug("put_cred_rcu(%p)", cred); in put_cred_rcu()
74 if (atomic_long_read(&cred->usage) != 0) in put_cred_rcu()
76 cred, atomic_long_read(&cred->usage)); in put_cred_rcu()
78 security_cred_free(cred); in put_cred_rcu()
79 key_put(cred->session_keyring); in put_cred_rcu()
80 key_put(cred->process_keyring); in put_cred_rcu()
81 key_put(cred->thread_keyring); in put_cred_rcu()
82 key_put(cred->request_key_auth); in put_cred_rcu()
[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 …]
/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()
47 static inline struct aa_label *aa_cred_raw_label(const struct cred *cred) in aa_cred_raw_label() argument
49 struct aa_label *label = cred_label(cred); in aa_cred_raw_label()
61 static inline struct aa_label *aa_get_newest_cred_label(const struct cred *cred) in aa_get_newest_cred_label() argument
63 return aa_get_newest_label(aa_cred_raw_label(cred)); in aa_get_newest_cred_label()
66 static inline struct aa_label *aa_get_newest_cred_label_condref(const struct cred *cred, in aa_get_newest_cred_label_condref() argument
69 struct aa_label *l = aa_cred_raw_label(cred); in aa_get_newest_cred_label_condref()
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.c68 static inline int cap_capable_helper(const struct cred *cred, in cap_capable_helper() argument
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()
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->user_ns; in cap_capable()
128 int ret = cap_capable_helper(cred, target_ns, cred_ns, cap); in cap_capable()
130 trace_cap_capable(cred, target_ns, cred_ns, cap, ret); in cap_capable()
167 const struct cred *cred, *child_cred; in cap_ptrace_access_check() local
171 cred = current_cred(); in cap_ptrace_access_check()
174 caller_caps = &cred->cap_effective; in cap_ptrace_access_check()
[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/rust/helpers/
H A Dcred.c5 const struct cred *rust_helper_get_cred(const struct cred *cred) in rust_helper_get_cred() argument
7 return get_cred(cred); in rust_helper_get_cred()
10 void rust_helper_put_cred(const struct cred *cred) in rust_helper_put_cred() argument
12 put_cred(cred); in rust_helper_put_cred()
H A Dsecurity.c6 void rust_helper_security_cred_getsecid(const struct cred *c, u32 *secid) in rust_helper_security_cred_getsecid()
21 int rust_helper_security_binder_set_context_mgr(const struct cred *mgr) in rust_helper_security_binder_set_context_mgr()
26 int rust_helper_security_binder_transaction(const struct cred *from, in rust_helper_security_binder_transaction()
27 const struct cred *to) in rust_helper_security_binder_transaction()
32 int rust_helper_security_binder_transfer_binder(const struct cred *from, in rust_helper_security_binder_transfer_binder()
33 const struct cred *to) in rust_helper_security_binder_transfer_binder()
38 int rust_helper_security_binder_transfer_file(const struct cred *from, in rust_helper_security_binder_transfer_file()
39 const struct cred *to, in rust_helper_security_binder_transfer_file()
/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/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/security/landlock/
H A Dcred.c19 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() argument
40 struct landlock_ruleset *const dom = landlock_cred(cred)->domain; in hook_cred_free()
51 landlock_cred(bprm->cred)->domain_exec = 0; in hook_bprm_creds_for_exec()
/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/fs/nfs/
H A Dnfs4_fs.h70 nfs4_stateid *, const struct cred *);
116 const struct cred *so_cred; /* Associated cred */
224 int (*establish_clid)(struct nfs_client *, const struct cred *);
225 int (*reclaim_complete)(struct nfs_client *, const struct cred *);
227 const struct cred *);
256 const struct cred *cred; member
260 int (*sched_state_renewal)(struct nfs_client *, const struct cred *, unsigned);
261 const struct cred * (*get_state_renewal_cred)(struct nfs_client *);
262 int (*renew_lease)(struct nfs_client *, const struct cred *);
267 struct nfs4_fs_locations *, struct page *, const struct cred *);
[all …]
H A Dnfs4state.c113 int nfs4_init_clientid(struct nfs_client *clp, const struct cred *cred) in nfs4_init_clientid() argument
129 status = nfs4_proc_setclientid(clp, NFS4_CALLBACK, port, cred, &clid); in nfs4_init_clientid()
136 status = nfs4_proc_setclientid_confirm(clp, &clid, cred); in nfs4_init_clientid()
160 const struct cred *cred) in nfs40_discover_server_trunking() argument
174 status = nfs4_proc_setclientid(clp, NFS4_CALLBACK, port, cred, &clid); in nfs40_discover_server_trunking()
180 status = nfs40_walk_client_list(clp, result, cred); in nfs40_discover_server_trunking()
194 const struct cred *nfs4_get_machine_cred(struct nfs_client *clp) in nfs4_get_machine_cred()
207 static const struct cred *
210 const struct cred *cred = NULL; in nfs4_get_renew_cred_server_locked() local
220 cred = get_cred(sp->so_cred); in nfs4_get_renew_cred_server_locked()
[all …]
/linux/net/sunrpc/auth_gss/
H A Dauth_gss.c133 gss_cred_set_ctx(struct rpc_cred *cred, struct gss_cl_ctx *ctx) in gss_cred_set_ctx() argument
135 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base); in gss_cred_set_ctx()
137 if (!test_bit(RPCAUTH_CRED_NEW, &cred->cr_flags)) in gss_cred_set_ctx()
141 set_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags); in gss_cred_set_ctx()
143 clear_bit(RPCAUTH_CRED_NEW, &cred->cr_flags); in gss_cred_set_ctx()
147 gss_cred_get_ctx(struct rpc_cred *cred) in gss_cred_get_ctx() argument
149 struct gss_cred *gss_cred = container_of(cred, struct gss_cred, gc_base); in gss_cred_get_ctx()
406 const struct cred *cred) in gss_encode_v0_msg() argument
408 struct user_namespace *userns = cred->user_ns; in gss_encode_v0_msg()
433 const struct cred *cred) in gss_encode_v1_msg() argument
[all …]

12345678910>>...13