diff options
author | Todd Kjos <tkjos@android.com> | 2017-06-29 12:01:36 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-30 10:19:26 +0200 |
commit | 596b97ec2e5e24c966b9cb4aa9a9766e53ecdd43 (patch) | |
tree | 2a117120b2641b93de4c31e31cbaa6835550028d | |
parent | e1c7a447883305fd757ca76950d5ef2b4155cebc (diff) |
binder: use group leader instead of open thread
commit c4ea41ba195d01c9af66fb28711a16cc97caa9c5 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: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/android/binder.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 47ddfefe2443..76650faca2f6 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -2966,8 +2966,8 @@ static int binder_open(struct inode *nodp, struct file *filp) proc = kzalloc(sizeof(*proc), GFP_KERNEL); if (proc == NULL) return -ENOMEM; - get_task_struct(current); - proc->tsk = current; + get_task_struct(current->group_leader); + proc->tsk = current->group_leader; INIT_LIST_HEAD(&proc->todo); init_waitqueue_head(&proc->wait); proc->default_priority = task_nice(current); |