Skip to content

Commit

Permalink
KEYS: Reinstate lost passing of process keyring ID in call_sbin_reque…
Browse files Browse the repository at this point in the history
…st_key()

In commit bb952bb 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>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Justin P. Mattock authored and James Morris committed Aug 2, 2010
1 parent 94fd840 commit 5ad18a0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions security/keys/request_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ad18a0

Please sign in to comment.