Skip to contentSkip to conversation

KEYS: Reinstate lost passing of process keyring ID in call_sbin_request_key()

PATCH In review David Howells 2 participants 2 messages Jun 30, 2010 – Jul 1, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

David Howells

author maintainer
#1 lore raw

PATCH 1/1 KEYS: Reinstate lost passing of process keyring ID in call_sbin_request_key()

From: Justin P. Mattock <[email protected]>

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.

---

 security/keys/request_key.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
security/keys/request_key.c +1 -0
index f5ec9ac..0d26f68 100644
@@ -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);
maintainer
#2 lore raw
Quoted 12 lines · David Howells

From: Justin P. Mattock <[email protected]>

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

Quoted 7 lines

This patch reinstates that statement.

Without this statement, /sbin/request-key will get some random rubbish from the stack as that parameter.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

Signature · 2 lines
James Morris
<[email protected]>