]> git.baikalelectronics.ru Git - kernel.git/commit
Set cred->user_ns in key_replace_session_keyring
authorSerge E. Hallyn <serge@hallyn.com>
Thu, 26 May 2011 20:25:05 +0000 (15:25 -0500)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 May 2011 20:49:19 +0000 (13:49 -0700)
commite6555b0739622c58822a7521f51b41694d38afbf
tree956fff16b2327818eae72cfe47cf2260986e2fd2
parent6fc1a335d58f5f7e93236e1c2dd885398faee558
Set cred->user_ns in key_replace_session_keyring

Since this cred was not created with copy_creds(), it needs to get
initialized.  Otherwise use of syscall(__NR_keyctl, KEYCTL_SESSION_TO_PARENT);
can lead to a NULL deref.  Thanks to Robert for finding this.

But introduced by commit b47b7bdae12 ("Cache user_ns in struct cred").

Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Reported-by: Robert Święcki <robert@swiecki.net>
Cc: David Howells <dhowells@redhat.com>
Cc: stable@kernel.org (2.6.39)
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
security/keys/process_keys.c