summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-03-25 12:06:51 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 17:22:50 +0100
commit3dccff8dc00994428777f483922058c554db85bd (patch)
tree14c72fa82afa4e325c4aaa3f84c31ab154f60b1d /security
parent[PATCH] x86: HUGETLBFS and DEBUG_PAGEALLOC are incompatible (diff)
downloadlinux-3dccff8dc00994428777f483922058c554db85bd.tar.xz
linux-3dccff8dc00994428777f483922058c554db85bd.zip
[PATCH] Keys: Fix key quota management on key allocation
Make key quota detection generate an error if either quota is exceeded rather than only if both quotas are exceeded. 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')
-rw-r--r--security/keys/key.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 99781b798312..627697181e6a 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -1,6 +1,6 @@
/* key.c: basic authentication token and access key management
*
- * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
+ * Copyright (C) 2004-6 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
*
* This program is free software; you can redistribute it and/or
@@ -271,7 +271,7 @@ struct key *key_alloc(struct key_type *type, const char *desc,
* its description */
if (!not_in_quota) {
spin_lock(&user->lock);
- if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS &&
+ if (user->qnkeys + 1 >= KEYQUOTA_MAX_KEYS ||
user->qnbytes + quotalen >= KEYQUOTA_MAX_BYTES
)
goto no_quota;