diff options
author | David Howells <dhowells@redhat.com> | 2006-06-26 03:24:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:18 -0400 |
commit | 7e047ef5fe2d52e83020e856b1bf2556a6a2ce98 (patch) | |
tree | 97656e2c56a27be9d1da451dde627b693b8643f2 /security/keys/keyctl.c | |
parent | f116629d03655adaf7832b93b03c99391d09d4a7 (diff) |
[PATCH] keys: sort out key quota system
Add the ability for key creation to overrun the user's quota in some
circumstances - notably when a session keyring is created and assigned to a
process that didn't previously have one.
This means it's still possible to log in, should PAM require the creation of a
new session keyring, and fix an overburdened key quota.
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 'security/keys/keyctl.c')
-rw-r--r-- | security/keys/keyctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index ed71d86d2ce2..d74458522e98 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -102,7 +102,7 @@ asmlinkage long sys_add_key(const char __user *_type, | |||
102 | /* create or update the requested key and add it to the target | 102 | /* create or update the requested key and add it to the target |
103 | * keyring */ | 103 | * keyring */ |
104 | key_ref = key_create_or_update(keyring_ref, type, description, | 104 | key_ref = key_create_or_update(keyring_ref, type, description, |
105 | payload, plen, 0); | 105 | payload, plen, KEY_ALLOC_IN_QUOTA); |
106 | if (!IS_ERR(key_ref)) { | 106 | if (!IS_ERR(key_ref)) { |
107 | ret = key_ref_to_ptr(key_ref)->serial; | 107 | ret = key_ref_to_ptr(key_ref)->serial; |
108 | key_ref_put(key_ref); | 108 | key_ref_put(key_ref); |
@@ -184,7 +184,8 @@ asmlinkage long sys_request_key(const char __user *_type, | |||
184 | 184 | ||
185 | /* do the search */ | 185 | /* do the search */ |
186 | key = request_key_and_link(ktype, description, callout_info, | 186 | key = request_key_and_link(ktype, description, callout_info, |
187 | key_ref_to_ptr(dest_ref)); | 187 | key_ref_to_ptr(dest_ref), |
188 | KEY_ALLOC_IN_QUOTA); | ||
188 | if (IS_ERR(key)) { | 189 | if (IS_ERR(key)) { |
189 | ret = PTR_ERR(key); | 190 | ret = PTR_ERR(key); |
190 | goto error5; | 191 | goto error5; |