summaryrefslogtreecommitdiff
path: root/drivers/android
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@android.com>2017-06-29 22:01:36 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-17 15:44:19 +0300
commitc4ea41ba195d01c9af66fb28711a16cc97caa9c5 (patch)
tree5cfe300d999b4f73470931423fb439a20a089caa /drivers/android
parenta2b18708ee14baec4ef9c0fba96070bba14d0081 (diff)
downloadlinux-c4ea41ba195d01c9af66fb28711a16cc97caa9c5.tar.xz
binder: use group leader instead of open thread
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> Cc: stable <stable@vger.kernel.org> # 4.4+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
-rw-r--r--drivers/android/binder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 157bd3e49ff4..9393924ae8e8 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -3460,8 +3460,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);