summaryrefslogtreecommitdiff
path: root/drivers/android
diff options
context:
space:
mode:
authorHridya Valsaraju <hridya@google.com>2019-07-15 12:18:04 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-31 07:28:57 +0200
commit74402b5c3f829dcfce4f5a49d49e77dc3bed82c9 (patch)
tree46f1f2c610bb4bbc10c4110b2a1a3bad30a9db44 /drivers/android
parent6378b847d70c331f1ef8fe377c42c80fe78f5fcd (diff)
binder: prevent transactions to context manager from its own process.
commit 49ed96943a8e0c62cc5a9b0a6cfc88be87d1fcec upstream. Currently, a transaction to context manager from its own process is prevented by checking if its binder_proc struct is the same as that of the sender. However, this would not catch cases where the process opens the binder device again and uses the new fd to send a transaction to the context manager. Reported-by: syzbot+8b3c354d33c4ac78bfad@syzkaller.appspotmail.com Signed-off-by: Hridya Valsaraju <hridya@google.com> Acked-by: Todd Kjos <tkjos@google.com> Cc: stable <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20190715191804.112933-1-hridya@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/android')
-rw-r--r--drivers/android/binder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 1af9f36f89cf..e694fd2c4ed0 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -2785,7 +2785,7 @@ static void binder_transaction(struct binder_proc *proc,
else
return_error = BR_DEAD_REPLY;
mutex_unlock(&context->context_mgr_node_lock);
- if (target_node && target_proc == proc) {
+ if (target_node && target_proc->pid == proc->pid) {
binder_user_error("%d:%d got transaction to context manager from process owning it\n",
proc->pid, thread->pid);
return_error = BR_FAILED_REPLY;