• Home
  • Raw
  • Download

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.
120 unsigned securebits; /* SUID-less security management */
129 struct key *session_keyring; /* keyring inherited over fork */
130 struct key *process_keyring; /* keyring private to this process */
131 struct key *thread_keyring; /* keyring private to this thread */
132 struct key *request_key_auth; /* assumed request_key authority */
169 return cap_issubset(cred->cap_ambient, in cap_ambient_invariant_ok()
170 cap_intersect(cred->cap_permitted, in cap_ambient_invariant_ok()
171 cred->cap_inheritable)); in cap_ambient_invariant_ok()
175 * get_new_cred - Get a reference on a new set of credentials
179 * release the reference.
183 atomic_long_inc(&cred->usage); in get_new_cred()
188 * get_cred - Get a reference on a set of credentials
192 * release the reference. If %NULL is passed, it is returned with no action.
205 nonconst_cred->non_rcu = 0; in get_cred()
214 if (!atomic_long_inc_not_zero(&nonconst_cred->usage)) in get_cred_rcu()
216 nonconst_cred->non_rcu = 0; in get_cred_rcu()
221 * put_cred - Release a reference to a set of credentials
222 * @cred: The credentials to release
224 * Release a reference to a set of credentials, deleting them when the last ref
236 if (atomic_long_dec_and_test(&(cred)->usage)) in put_cred()
242 * current_cred - Access the current task's subjective credentials
244 * Access the subjective credentials of the current task. RCU-safe,
248 rcu_dereference_protected(current->cred, 1)
251 * current_real_cred - Access the current task's objective credentials
253 * Access the objective credentials of the current task. RCU-safe,
257 rcu_dereference_protected(current->real_cred, 1)
260 * __task_cred - Access a task's objective credentials
270 rcu_dereference((task)->real_cred)
273 * get_current_cred - Get the current task's subjective credentials
283 * get_current_user - Get the current task's user_struct
293 __u = get_uid(__cred->user); \
298 * get_current_groups - Get the current task's supplementary group list
308 __groups = get_group_info(__cred->group_info); \
314 __typeof__(((struct cred *)NULL)->xxx) ___val; \
316 ___val = __task_cred((task))->xxx; \
327 current_cred()->xxx; \
357 *(_uid) = __cred->uid; \
358 *(_gid) = __cred->gid; \
365 *(_euid) = __cred->euid; \
366 *(_egid) = __cred->egid; \
373 *(_fsuid) = __cred->fsuid; \
374 *(_fsgid) = __cred->fsgid; \