From: David Howells <dhowells@redhat.com>
To: linux-security-module@vger.kernel.org
Cc: keyrings@linux-nfs.org, linux-kernel@vger.kernel.org,
"Justin P. Mattock" <justinmattock@gmail.com>,
David Howells <dhowells@redhat.com>
Subject: [PATCH] KEYS: Reinstate lost passing of process keyring ID in call_sbin_request_key()
Date: Wed, 30 Jun 2010 10:39:11 +0100 [thread overview]
Message-ID: <20100630093911.28103.73746.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <1277861297-13824-1-git-send-email-justinmattock@gmail.com>
From: Justin P. Mattock <justinmattock@gmail.com>
In commit bb952bb98a7e479262c7eb25d5592545a3af147d there was the accidental
deletion of a statement from call_sbin_request_key() to render the process
keyring ID to a text string so that it can be passed to /sbin/request-key.
With gcc 4.6.0 this causes the following warning:
CC security/keys/request_key.o
security/keys/request_key.c: In function 'call_sbin_request_key':
security/keys/request_key.c:102:15: warning: variable 'prkey' set but not used
This patch reinstates that statement.
Without this statement, /sbin/request-key will get some random rubbish from the
stack as that parameter.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
---
security/keys/request_key.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index f5ec9ac..0d26f68 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -144,6 +144,7 @@ static int call_sbin_request_key(struct key_construction *cons,
prkey = 0;
if (cred->tgcred->process_keyring)
prkey = cred->tgcred->process_keyring->serial;
+ sprintf(keyring_str[1], "%d", prkey);
rcu_read_lock();
session = rcu_dereference(cred->tgcred->session_keyring);
next parent reply other threads:[~2010-06-30 9:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1277861297-13824-1-git-send-email-justinmattock@gmail.com>
2010-06-30 9:39 ` David Howells [this message]
2010-07-01 0:19 ` James Morris
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=20100630093911.28103.73746.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=justinmattock@gmail.com \
--cc=keyrings@linux-nfs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.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
all inboxes | Powered by JetHome®