binder: prevent transactions to context manager from its own process.
authorHridya Valsaraju <hridya@google.com>
Mon, 15 Jul 2019 19:18:04 +0000 (12:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:27:10 +0000 (07:27 +0200)
commite907b1314481c8586ff3793fd92c7dbd8aa841ae
treee3c231ceb09f41896b81ca94e643c14cd1c7a726
parent7d20e3ba707211c9e571cf0a5fc5fc0442f74313
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>
drivers/android/binder.c