Skip to content

Commit

Permalink
CRED: Must initialise the new creds in prepare_kernel_cred()
Browse files Browse the repository at this point in the history
The newly allocated creds in prepare_kernel_cred() must be initialised
before get_uid() and get_group_info() can access them.  They should be
copied from the old credentials.

Reported-by: Steve Dickson <steved@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Jan 9, 2009
1 parent 0de3368 commit 43529c9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ struct cred *prepare_kernel_cred(struct task_struct *daemon)
else
old = get_cred(&init_cred);

*new = *old;
get_uid(new->user);
get_group_info(new->group_info);

Expand Down

0 comments on commit 43529c9

Please sign in to comment.