diff options
author | David Howells <dhowells@redhat.com> | 2008-04-29 04:01:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:17 -0400 |
commit | 69664cf16af4f31cd54d77948a4baf9c7e0ca7b9 (patch) | |
tree | 3ff4ecae21c140a2beed25cfa9e55b788f9814ac /security/selinux | |
parent | 6b79ccb5144f9ffb4d4596c23e7570238dd12abc (diff) |
keys: don't generate user and user session keyrings unless they're accessed
Don't generate the per-UID user and user session keyrings unless they're
explicitly accessed. This solves a problem during a login process whereby
set*uid() is called before the SELinux PAM module, resulting in the per-UID
keyrings having the wrong security labels.
This also cures the problem of multiple per-UID keyrings sometimes appearing
due to PAM modules (including pam_keyinit) setuiding and causing user_structs
to come into and go out of existence whilst the session keyring pins the user
keyring. This is achieved by first searching for extant per-UID keyrings
before inventing new ones.
The serial bound argument is also dropped from find_keyring_by_name() as it's
not currently made use of (setting it to 0 disables the feature).
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: <kwc@citi.umich.edu>
Cc: <arunsr@cse.iitk.ac.in>
Cc: <dwalsh@redhat.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Cc: James Morris <jmorris@namei.org>
Cc: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'security/selinux')
-rw-r--r-- | security/selinux/hooks.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 838d1e5e63a1..4e4de98941ae 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -5551,14 +5551,6 @@ static __init int selinux_init(void) | |||
5551 | else | 5551 | else |
5552 | printk(KERN_DEBUG "SELinux: Starting in permissive mode\n"); | 5552 | printk(KERN_DEBUG "SELinux: Starting in permissive mode\n"); |
5553 | 5553 | ||
5554 | #ifdef CONFIG_KEYS | ||
5555 | /* Add security information to initial keyrings */ | ||
5556 | selinux_key_alloc(&root_user_keyring, current, | ||
5557 | KEY_ALLOC_NOT_IN_QUOTA); | ||
5558 | selinux_key_alloc(&root_session_keyring, current, | ||
5559 | KEY_ALLOC_NOT_IN_QUOTA); | ||
5560 | #endif | ||
5561 | |||
5562 | return 0; | 5554 | return 0; |
5563 | } | 5555 | } |
5564 | 5556 | ||