lkml.org 
[lkml]   [2009]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] CRED: Must initialise the new creds in prepare_kernel_cred()
Date
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>
---

kernel/cred.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/cred.c b/kernel/cred.c
index 400e608..3a03918 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -507,6 +507,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);



\
 
 \ /
  Last update: 2009-01-09 17:17    [W:0.239 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site