linux-stable/drivers/android
Tyler Hicks b4b9073a8a binder: take read mode of mmap_sem in binder_alloc_free_page()
commit 60d4885710 upstream.

Restore the behavior of locking mmap_sem for reading in
binder_alloc_free_page(), as was first done in commit 3013bf62b6
("binder: reduce mmap_sem write-side lock"). That change was
inadvertently reverted by commit 5cec2d2e58 ("binder: fix race between
munmap() and direct reclaim").

In addition, change the name of the label for the error path to
accurately reflect that we're taking the lock for reading.

Backporting note: This fix is only needed when *both* of the commits
mentioned above are applied. That's an unlikely situation since they
both landed during the development of v5.1 but only one of them is
targeted for stable.

Fixes: 5cec2d2e58 ("binder: fix race between munmap() and direct reclaim")
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Todd Kjos <tkjos@android.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-02 17:25:48 +02:00
..
binder.c android: binder: no outgoing transaction when thread todo has transaction 2019-11-20 18:46:42 +01:00
binder_alloc.c binder: take read mode of mmap_sem in binder_alloc_free_page() 2020-05-02 17:25:48 +02:00
binder_alloc.h binder: fix race that allows malicious free of live buffer 2018-12-05 19:32:11 +01:00
binder_alloc_selftest.c android: binder: Add global lru shrinker to binder 2017-08-28 16:47:17 +02:00
binder_trace.h android: binder: Show extra_buffers_size in trace 2018-08-02 10:34:12 +02:00
Kconfig android: binder: Drop dependency on !M68K 2018-07-07 17:44:52 +02:00
Makefile android: binder: Add allocator selftest 2017-08-28 16:47:17 +02:00