mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: torvalds@osdl.org, akpm@osdl.org
Cc: keyrings@linux-nfs.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Keys: Fix permissions check for update vs add
Date: Wed, 30 Nov 2005 18:17:27 +0000	[thread overview]
Message-ID: <32609.1133374647@warthog.cambridge.redhat.com> (raw)


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;

                 reply	other threads:[~2005-11-30 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32609.1133374647@warthog.cambridge.redhat.com \
    --to=dhowells@redhat.com \
    --cc=akpm@osdl.org \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome