]> git.baikalelectronics.ru Git - kernel.git/commit
binder: check for binder_thread allocation failure in binder_poll()
authorEric Biggers <ebiggers@google.com>
Wed, 31 Jan 2018 07:11:24 +0000 (23:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 10:15:44 +0000 (11:15 +0100)
commitcc1f6009e3a1fe737bac7c0ced63d2112180bb13
treefe9af10dcb73db2bea487a81e71c1cc091f786e2
parentae0945d7fbe5a6a5e767169d0c9ca622784b3c38
binder: check for binder_thread allocation failure in binder_poll()

If the kzalloc() in binder_get_thread() fails, binder_poll()
dereferences the resulting NULL pointer.

Fix it by returning POLLERR if the memory allocation failed.

This bug was found by syzkaller using fault injection.

Reported-by: syzbot <syzkaller@googlegroups.com>
Fixes: fbc65853e41e ("Staging: android: add binder driver")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder.c