summaryrefslogtreecommitdiff
path: root/include/linux/key.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2005-03-09 16:42:51 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-03-09 16:42:51 -0800
commitf6480aaa10f6a4bdcf1b52b0d101cda725b8a177 (patch)
treea87c7cfacbea086dedc22f00d96c2cd1832d4817 /include/linux/key.h
parent13ae0ab182f083877990070b8da8f478f89b7615 (diff)
[PATCH] Properly share process and session keyrings with CLONE_THREAD [try #2]
The attached patch causes process and session keyrings to be shared properly when CLONE_THREAD is in force. It does this by moving the keyring pointers into struct signal_struct[*]. [*] I have a patch to rename this to struct thread_group that I'll revisit after the advent of 2.6.11. Furthermore, once this patch is applied, process keyrings will no longer be allocated at fork, but will instead only be allocated when needed. Allocating them at fork was a way of half getting around the sharing across threads problem, but that's no longer necessary. This revision of the patch has the documentation changes patch rolled into it and no longer abstracts the locking for signal_struct into a pair of macros. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h5
1 files changed, 5 insertions, 0 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)