Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264507
b: refs/heads/master
c: 012146d
h: refs/heads/master
i:
  264505: b73a5b7
  264503: 54fe854
v: v3
  • Loading branch information
David Howells authored and James Morris committed Aug 22, 2011
1 parent 4c7a325 commit e1a3363
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d528b082294f0ddabd6368297546a2c0b67d4fe
refs/heads/master: 012146d0728f85f7a5c7c36fb84bba33e2760507
16 changes: 14 additions & 2 deletions trunk/kernel/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,22 @@ void __init cred_init(void)
*/
struct cred *prepare_kernel_cred(struct task_struct *daemon)
{
#ifdef CONFIG_KEYS
struct thread_group_cred *tgcred;
#endif
const struct cred *old;
struct cred *new;

new = kmem_cache_alloc(cred_jar, GFP_KERNEL);
if (!new)
return NULL;

tgcred = kmalloc(sizeof(*tgcred), GFP_KERNEL);
if (!tgcred) {
kmem_cache_free(cred_jar, new);
return NULL;
}

kdebug("prepare_kernel_cred() alloc %p", new);

if (daemon)
Expand All @@ -669,8 +678,11 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
get_group_info(new->group_info);

#ifdef CONFIG_KEYS
atomic_inc(&init_tgcred.usage);
new->tgcred = &init_tgcred;
atomic_set(&tgcred->usage, 1);
spin_lock_init(&tgcred->lock);
tgcred->process_keyring = NULL;
tgcred->session_keyring = NULL;
new->tgcred = tgcred;
new->request_key_auth = NULL;
new->thread_keyring = NULL;
new->jit_keyring = KEY_REQKEY_DEFL_THREAD_KEYRING;
Expand Down

0 comments on commit e1a3363

Please sign in to comment.