Lines Matching refs:cred

19 struct cred;
65 extern void set_groups(struct cred *, struct group_info *);
110 struct cred { struct
155 extern void __put_cred(struct cred *); argument
158 extern const struct cred *get_task_cred(struct task_struct *);
159 extern struct cred *cred_alloc_blank(void);
160 extern struct cred *prepare_creds(void);
161 extern struct cred *prepare_exec_creds(void);
162 extern int commit_creds(struct cred *);
163 extern void abort_creds(struct cred *);
164 extern const struct cred *override_creds(const struct cred *);
165 extern void revert_creds(const struct cred *);
166 extern struct cred *prepare_kernel_cred(struct task_struct *);
167 extern int change_create_files_as(struct cred *, struct inode *);
168 extern int set_security_override(struct cred *, u32);
169 extern int set_security_override_from_ctx(struct cred *, const char *);
170 extern int set_create_files_as(struct cred *, struct inode *);
171 extern int cred_fscmp(const struct cred *, const struct cred *);
173 extern int set_cred_ucounts(struct cred *);
179 extern void __noreturn __invalid_creds(const struct cred *, const char *, unsigned);
183 extern bool creds_are_invalid(const struct cred *cred);
185 static inline void __validate_creds(const struct cred *cred, in __validate_creds() argument
188 if (unlikely(creds_are_invalid(cred))) in __validate_creds()
189 __invalid_creds(cred, file, line); in __validate_creds()
192 #define validate_creds(cred) \ argument
194 __validate_creds((cred), __FILE__, __LINE__); \
204 static inline void validate_creds(const struct cred *cred) in validate_creds() argument
215 static inline bool cap_ambient_invariant_ok(const struct cred *cred) in cap_ambient_invariant_ok() argument
217 return cap_issubset(cred->cap_ambient, in cap_ambient_invariant_ok()
218 cap_intersect(cred->cap_permitted, in cap_ambient_invariant_ok()
219 cred->cap_inheritable)); in cap_ambient_invariant_ok()
229 static inline struct cred *get_new_cred(struct cred *cred) in get_new_cred() argument
231 atomic_inc(&cred->usage); in get_new_cred()
232 return cred; in get_new_cred()
248 static inline const struct cred *get_cred(const struct cred *cred) in get_cred() argument
250 struct cred *nonconst_cred = (struct cred *) cred; in get_cred()
251 if (!cred) in get_cred()
252 return cred; in get_cred()
253 validate_creds(cred); in get_cred()
258 static inline const struct cred *get_cred_rcu(const struct cred *cred) in get_cred_rcu() argument
260 struct cred *nonconst_cred = (struct cred *) cred; in get_cred_rcu()
261 if (!cred) in get_cred_rcu()
265 validate_creds(cred); in get_cred_rcu()
267 return cred; in get_cred_rcu()
281 static inline void put_cred(const struct cred *_cred) in put_cred()
283 struct cred *cred = (struct cred *) _cred; in put_cred() local
285 if (cred) { in put_cred()
286 validate_creds(cred); in put_cred()
287 if (atomic_dec_and_test(&(cred)->usage)) in put_cred()
288 __put_cred(cred); in put_cred()
299 rcu_dereference_protected(current->cred, 1)
342 const struct cred *__cred; \
357 const struct cred *__cred; \
365 __typeof__(((struct cred *)NULL)->xxx) ___val; \
406 const struct cred *__cred; \
414 const struct cred *__cred; \
422 const struct cred *__cred; \