• Tyler Hicks's avatar
    binder: take read mode of mmap_sem in binder_alloc_free_page() · b4b9073a
    Tyler Hicks authored
    commit 60d48857 upstream.
    
    Restore the behavior of locking mmap_sem for reading in
    binder_alloc_free_page(), as was first done in commit 3013bf62
    ("binder: reduce mmap_sem write-side lock"). That change was
    inadvertently reverted by commit 5cec2d2e ("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: 5cec2d2e ("binder: fix race between munmap() and direct reclaim")
    Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
    Acked-by: default avatarTodd Kjos <tkjos@android.com>
    Cc: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    b4b9073a
binder_alloc.c 28.3 KB