summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/key.h5
-rw-r--r--include/linux/sched.h9
2 files changed, 12 insertions, 2 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index 15eaba537341..6aa46d0e812f 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -58,6 +58,7 @@ struct key;
struct seq_file;
struct user_struct;
+struct signal_struct;
struct key_type;
struct key_owner;
@@ -258,7 +259,9 @@ extern struct key root_user_keyring, root_session_keyring;
extern int alloc_uid_keyring(struct user_struct *user);
extern void switch_uid_keyring(struct user_struct *new_user);
extern int copy_keys(unsigned long clone_flags, struct task_struct *tsk);
+extern int copy_thread_group_keys(struct task_struct *tsk);
extern void exit_keys(struct task_struct *tsk);
+extern void exit_thread_group_keys(struct signal_struct *tg);
extern int suid_keys(struct task_struct *tsk);
extern int exec_keys(struct task_struct *tsk);
extern void key_fsuid_changed(struct task_struct *tsk);
@@ -274,7 +277,9 @@ extern void key_init(void);
#define alloc_uid_keyring(u) 0
#define switch_uid_keyring(u) do { } while(0)
#define copy_keys(f,t) 0
+#define copy_thread_group_keys(t) 0
#define exit_keys(t) do { } while(0)
+#define exit_thread_group_keys(tg) do { } while(0)
#define suid_keys(t) do { } while(0)
#define exec_keys(t) do { } while(0)
#define key_fsuid_changed(t) do { } while(0)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index cf90d1ed1a1f..f564b18dbaed 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -348,6 +348,13 @@ struct signal_struct {
struct rlimit rlim[RLIM_NLIMITS];
struct list_head cpu_timers[3];
+
+ /* keep the process-shared keyrings here so that they do the right
+ * thing in threads created with CLONE_THREAD */
+#ifdef CONFIG_KEYS
+ struct key *session_keyring; /* keyring inherited over fork */
+ struct key *process_keyring; /* keyring private to this process */
+#endif
};
/*
@@ -631,8 +638,6 @@ struct task_struct {
unsigned keep_capabilities:1;
struct user_struct *user;
#ifdef CONFIG_KEYS
- struct key *session_keyring; /* keyring inherited over fork */
- struct key *process_keyring; /* keyring private to this process (CLONE_THREAD) */
struct key *thread_keyring; /* keyring private to this thread */
#endif
int oomkilladj; /* OOM kill score adjustment (bit shift). */