mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
CRED: Separate per-task-group keyrings from signal_struct
Separate per-task-group keyrings from signal_struct and dangle their anchor from the cred struct rather than the signal_struct. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: James Morris <jmorris@namei.org> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
parent
275bb41e9d
commit
bb952bb98a
7 changed files with 135 additions and 99 deletions
|
@ -71,6 +71,21 @@ extern int groups_search(const struct group_info *, gid_t);
|
|||
extern int in_group_p(gid_t);
|
||||
extern int in_egroup_p(gid_t);
|
||||
|
||||
/*
|
||||
* The common credentials for a thread group
|
||||
* - shared by CLONE_THREAD
|
||||
*/
|
||||
#ifdef CONFIG_KEYS
|
||||
struct thread_group_cred {
|
||||
atomic_t usage;
|
||||
pid_t tgid; /* thread group process ID */
|
||||
spinlock_t lock;
|
||||
struct key *session_keyring; /* keyring inherited over fork */
|
||||
struct key *process_keyring; /* keyring private to this process */
|
||||
struct rcu_head rcu; /* RCU deletion hook */
|
||||
};
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The security context of a task
|
||||
*
|
||||
|
@ -114,6 +129,7 @@ struct cred {
|
|||
* keys to */
|
||||
struct key *thread_keyring; /* keyring private to this thread */
|
||||
struct key *request_key_auth; /* assumed request_key authority */
|
||||
struct thread_group_cred *tgcred; /* thread-group shared credentials */
|
||||
#endif
|
||||
#ifdef CONFIG_SECURITY
|
||||
void *security; /* subjective LSM security */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue