Skip to content

Commit f867c77

Browse files
Tetsuo Handagregkh
authored andcommitted
binder: Don't use mmput() from shrinker function.
syzbot is reporting that mmput() from shrinker function has a risk of deadlock [1], for delayed_uprobe_add() from update_ref_ctr() calls kzalloc(GFP_KERNEL) with delayed_uprobe_lock held, and uprobe_clear_state() from __mmput() also holds delayed_uprobe_lock. Commit a1b2289 ("android: binder: drop lru lock in isolate callback") replaced mmput() with mmput_async() in order to avoid sleeping with spinlock held. But this patch replaces mmput() with mmput_async() in order not to start __mmput() from shrinker context. [1] https://syzkaller.appspot.com/bug?id=bc9e7303f537c41b2b0cc2dfcea3fc42964c2d45 Reported-by: syzbot <[email protected]> Reported-by: syzbot <[email protected]> Signed-off-by: Tetsuo Handa <[email protected]> Reviewed-by: Michal Hocko <[email protected]> Acked-by: Todd Kjos <[email protected]> Acked-by: Christian Brauner <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b62e185 commit f867c77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/android/binder_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
947947
trace_binder_unmap_user_end(alloc, index);
948948
}
949949
mmap_read_unlock(mm);
950-
mmput(mm);
950+
mmput_async(mm);
951951

952952
trace_binder_unmap_kernel_start(alloc, index);
953953

0 commit comments

Comments
 (0)