Lines Matching +full:key +full:- +full:release

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* Credentials management - see Documentation/security/credentials.rst
13 #include <linux/key.h>
32 * get_group_info - Get a reference to a group info structure
42 atomic_inc(&gi->usage); in get_group_info()
47 * put_group_info - Release a reference to a group info structure
48 * @group_info: The group info to release
52 if (atomic_dec_and_test(&(group_info)->usage)) \
96 * upon another object, be that a file, a task, a key or whatever.
98 * Note that some members of this structure belong to both categories - the
101 * A task has two security pointers. task->real_cred points to the objective
105 * task->cred points to the subjective context that defines the details of how
108 * same context as task->real_cred.
127 unsigned securebits; /* SUID-less security management */
136 struct key *session_keyring; /* keyring inherited over fork */
137 struct key *process_keyring; /* keyring private to this process */
138 struct key *thread_keyring; /* keyring private to this thread */
139 struct key *request_key_auth; /* assumed request_key authority */
216 return cap_issubset(cred->cap_ambient, in cap_ambient_invariant_ok()
217 cap_intersect(cred->cap_permitted, in cap_ambient_invariant_ok()
218 cred->cap_inheritable)); in cap_ambient_invariant_ok()
222 * get_new_cred - Get a reference on a new set of credentials
226 * release the reference.
230 atomic_inc(&cred->usage); in get_new_cred()
235 * get_cred - Get a reference on a set of credentials
239 * release the reference. If %NULL is passed, it is returned with no action.
253 nonconst_cred->non_rcu = 0; in get_cred()
262 if (!atomic_inc_not_zero(&nonconst_cred->usage)) in get_cred_rcu()
265 nonconst_cred->non_rcu = 0; in get_cred_rcu()
270 * put_cred - Release a reference to a set of credentials
271 * @cred: The credentials to release
273 * Release a reference to a set of credentials, deleting them when the last ref
286 if (atomic_dec_and_test(&(cred)->usage)) in put_cred()
292 * current_cred - Access the current task's subjective credentials
294 * Access the subjective credentials of the current task. RCU-safe,
298 rcu_dereference_protected(current->cred, 1)
301 * current_real_cred - Access the current task's objective credentials
303 * Access the objective credentials of the current task. RCU-safe,
307 rcu_dereference_protected(current->real_cred, 1)
310 * __task_cred - Access a task's objective credentials
320 rcu_dereference((task)->real_cred)
323 * get_current_cred - Get the current task's subjective credentials
333 * get_current_user - Get the current task's user_struct
343 __u = get_uid(__cred->user); \
348 * get_current_groups - Get the current task's supplementary group list
358 __groups = get_group_info(__cred->group_info); \
364 __typeof__(((struct cred *)NULL)->xxx) ___val; \
366 ___val = __task_cred((task))->xxx; \
377 current_cred()->xxx; \
407 *(_uid) = __cred->uid; \
408 *(_gid) = __cred->gid; \
415 *(_euid) = __cred->euid; \
416 *(_egid) = __cred->egid; \
423 *(_fsuid) = __cred->fsuid; \
424 *(_fsgid) = __cred->fsgid; \