lkml.org 
[lkml]   [2005]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Keys: Fix permissions check for update vs add
Date

The attached patch permits add_key() to once again update a matching key
rather than adding a new one if a matching key already exists in the target
keyring.

This bug causes add_key() to always add a new key, displacing the old from the
target keyring.

Signed-Off-By: David Howells <dhowells@redhat.com>
---
warthog>diffstat -p1 keys-permfix-2615rc1.diff
security/keys/keyring.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

diff -uNr linux-2.6.15-rc1-keys-reqkey/security/keys/keyring.c linux-2.6.15-rc1-keys-permfix/security/keys/keyring.c
--- linux-2.6.15-rc1-keys-reqkey/security/keys/keyring.c 2005-11-16 17:55:47.000000000 +0000
+++ linux-2.6.15-rc1-keys-permfix/security/keys/keyring.c 2005-11-30 16:24:33.000000000 +0000
@@ -526,7 +526,7 @@
(!key->type->match ||
key->type->match(key, description)) &&
key_permission(make_key_ref(key, possessed),
- perm) < 0 &&
+ perm) == 0 &&
!test_bit(KEY_FLAG_REVOKED, &key->flags)
)
goto found;
-
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-11-30 19:20    [W:0.025 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site