Commit 51050750 authored by Todd Kjos's avatar Todd Kjos Committed by Greg Kroah-Hartman

binder: use group leader instead of open thread

commit c4ea41ba upstream.

The binder allocator assumes that the thread that
called binder_open will never die for the lifetime of
that proc. That thread is normally the group_leader,
however it may not be. Use the group_leader instead
of current.
Signed-off-by: default avatarTodd Kjos <tkjos@google.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eda70a55
...@@ -2972,8 +2972,8 @@ static int binder_open(struct inode *nodp, struct file *filp) ...@@ -2972,8 +2972,8 @@ static int binder_open(struct inode *nodp, struct file *filp)
proc = kzalloc(sizeof(*proc), GFP_KERNEL); proc = kzalloc(sizeof(*proc), GFP_KERNEL);
if (proc == NULL) if (proc == NULL)
return -ENOMEM; return -ENOMEM;
get_task_struct(current); get_task_struct(current->group_leader);
proc->tsk = current; proc->tsk = current->group_leader;
INIT_LIST_HEAD(&proc->todo); INIT_LIST_HEAD(&proc->todo);
init_waitqueue_head(&proc->wait); init_waitqueue_head(&proc->wait);
proc->default_priority = task_nice(current); proc->default_priority = task_nice(current);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment