Keys: Fix key quota management on key allocation
Subsystems (2)
David Howells
maintainerPATCH 1/1 Keys: Fix key quota management on key allocation
The attached patch makes key quota detection generate an error if either quota is exceeded rather than only if both quotas are exceeded.
Signed-off-by David Howells <[email protected]>
---
warthog>diffstat -p1 keys-quota-2616rc3.diff
security/keys/key.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
security/keys/key.c +2 -2
@@ -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 ([email protected]) * * This program is free software; you can redistribute it and/or
@@ -271,7 +271,7 @@ struct key *key_alloc(struct key_type *t* 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;