lkml.org 
[lkml]   [2005]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Keys: Possessor permissions should be additive
Date

This patch makes the possessor permissions on a key additive with
user/group/other permissions on the same key.

This permits extra rights to be granted to the possessor of a key without
taking away any rights conferred by them owning the key or having common group
membership.

This needs to be applied on top of the patch ensubjected:

[PATCH] Keys: Split key permissions checking into a .c file

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 keys-addperm-2614rc3.diff
security/keys/permission.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff -uNrp linux-2.6.14-rc3-keys-split/security/keys/permission.c linux-2.6.14-rc3-keys-addperm/security/keys/permission.c
--- linux-2.6.14-rc3-keys-split/security/keys/permission.c 2005-10-07 14:06:35.000000000 +0100
+++ linux-2.6.14-rc3-keys-addperm/security/keys/permission.c 2005-10-07 16:29:59.000000000 +0100
@@ -27,12 +27,6 @@ int key_task_permission(const key_ref_t

key = key_ref_to_ptr(key_ref);

- /* use the top 8-bits of permissions for keys the caller possesses */
- if (is_key_possessed(key_ref)) {
- kperm = key->perm >> 24;
- goto use_these_perms;
- }
-
/* use the second 8-bits of permissions for keys the caller owns */
if (key->uid == context->fsuid) {
kperm = key->perm >> 16;
@@ -61,6 +55,12 @@ int key_task_permission(const key_ref_t
kperm = key->perm;

use_these_perms:
+ /* use the top 8-bits of permissions for keys the caller possesses
+ * - possessor permissions are additive with other permissions
+ */
+ if (is_key_possessed(key_ref))
+ kperm |= key->perm >> 24;
+
kperm = kperm & perm & KEY_ALL;

return kperm == perm;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-07 17:44    [W:0.082 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site