]> git.baikalelectronics.ru Git - kernel.git/commit
binder: take read mode of mmap_sem in binder_alloc_free_page()
authorTyler Hicks <tyhicks@canonical.com>
Fri, 12 Apr 2019 21:59:25 +0000 (21:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Apr 2019 09:53:43 +0000 (11:53 +0200)
commit97b87fcb8731e75e6c5db397783bea02820c7a88
tree21efa1820f9c9907e6a22b04fece3394f308dead
parent849c20a3a7defdecda11bd5d4b35236c8538156d
binder: take read mode of mmap_sem in binder_alloc_free_page()

Restore the behavior of locking mmap_sem for reading in
binder_alloc_free_page(), as was first done in commit 3c39284ce43f
("binder: reduce mmap_sem write-side lock"). That change was
inadvertently reverted by commit 6cd78b3f41b2 ("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: 6cd78b3f41b2 ("binder: fix race between munmap() and direct reclaim")
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Todd Kjos <tkjos@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binder_alloc.c