summaryrefslogtreecommitdiff
path: root/kernel/cred.c
diff options
context:
space:
mode:
authorRandy Dunlap <randy.dunlap@oracle.com>2011-05-20 09:10:04 -0700
committerRandy Dunlap <randy.dunlap@oracle.com>2011-05-20 09:10:04 -0700
commit2f3e4af471e38e0658e701973238ae4b5e50fcd6 (patch)
treefbfc99c0d975e38ff80f4ff3239a9fc0567b8a4d /kernel/cred.c
parent61516587513c84ac26e68e3ab008dc6e965d0378 (diff)
parentd410fa4ef99112386de5f218dd7df7b4fca910b4 (diff)
Merge branch 'docs-security' into docs-move
Diffstat (limited to 'kernel/cred.c')
-rw-r--r--kernel/cred.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/cred.c b/kernel/cred.c
index 5557b55048df..004e3679624d 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -1,4 +1,4 @@
-/* Task credentials management - see Documentation/credentials.txt
+/* Task credentials management - see Documentation/security/credentials.txt
*
* Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
* Written by David Howells (dhowells@redhat.com)
@@ -54,6 +54,7 @@ struct cred init_cred = {
.cap_effective = CAP_INIT_EFF_SET,
.cap_bset = CAP_INIT_BSET,
.user = INIT_USER,
+ .user_ns = &init_user_ns,
.group_info = &init_groups,
#ifdef CONFIG_KEYS
.tgcred = &init_tgcred,
@@ -410,6 +411,11 @@ int copy_creds(struct task_struct *p, unsigned long clone_flags)
goto error_put;
}
+ /* cache user_ns in cred. Doesn't need a refcount because it will
+ * stay pinned by cred->user
+ */
+ new->user_ns = new->user->user_ns;
+
#ifdef CONFIG_KEYS
/* new threads get their own thread keyrings if their parent already
* had one */
@@ -741,12 +747,6 @@ int set_create_files_as(struct cred *new, struct inode *inode)
}
EXPORT_SYMBOL(set_create_files_as);
-struct user_namespace *current_user_ns(void)
-{
- return _current_user_ns();
-}
-EXPORT_SYMBOL(current_user_ns);
-
#ifdef CONFIG_DEBUG_CREDENTIALS
bool creds_are_invalid(const struct cred *cred)