]> asedeno.scripts.mit.edu Git - linux.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)
commit60d4885710836595192c42d3e04b27551d30ec91
tree21efa1820f9c9907e6a22b04fece3394f308dead
parente60e9a4b231a20a199d7a61caadc48693c30d695
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 3013bf62b67a
("binder: reduce mmap_sem write-side lock"). That change was
inadvertently reverted by commit 5cec2d2e5839 ("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: 5cec2d2e5839 ("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