Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4882837pjb; Mon, 27 Jul 2020 07:31:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPKdLJGHbc4ZD1/9VSB5L1j0QAsPtgRqDh/Y6A+xFrJztv3GMKBa2+rWEkImSwDA6ng/Pg X-Received: by 2002:aa7:d285:: with SMTP id w5mr4830820edq.125.1595860311860; Mon, 27 Jul 2020 07:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860311; cv=none; d=google.com; s=arc-20160816; b=k7Og5Qzlcpl28ku6bDnbQycfToDC31s3fYRPlDDOayge8kuANGbXK+SjtWq0FHuOLg RudbJhA5WuHyWawy/CWDXKpegFuxzE9xWjnhIDGzmLr0z5E1NLseA8jSW8DMCJIqRdh3 Eia2nI6lAuGdXxLriKxs7DJHR5uBbq2kZ9H0cyXInW+5Wx1O4UDYMhPG2uXZ0G/DS0if VeurhDUdJWC8NlGSv/nxt1MCELSxeGHJGOmY+LuZ12QmPVIhW+crftWXzSR0JQw9kPUg dXXT7GSiASsXgBD5XLhWb3OYiOM7zYt0B+hxR+4GtOHZtB6+UlIS+aaUwUihZRZJ1+em StQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1Nj+oblQTOIVbrvptoNC9vGKLZychIWqL0ewv8XdLhs=; b=er7Us6E7NXMuKOIyNRxvP4+CL8TOTMjg4AvIPJ+hrvGHs+OzO20WBaDPR5p/2K89KT qd8ghFvWi0qxLHAxJVD6kGaYe7ZoQRSrMYKIGIBe+GGS1C9+WzZlsenW1NyccKMAHOLT lDGIWyFAEXmwuR99ZU+ugNPIPyNyO5QLl+aE+GjQgScSm+g4aDiQ2+W0j9mS+93wKNT8 ly/6taJxcGI43AOKQU5u2/5/2eJ0QGBwN9Dey9quC9RhuqobUcqgzGgGuYKqxRlx9gwW zRqdv0Bsb0dP63Rq6IZNAOUbBNI3A3yBcq4EcQUQ23RnJ5OZVc/QjCzIf+u7WIUv1wdv DNKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ht+Xn13V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si5299098edj.414.2020.07.27.07.31.28; Mon, 27 Jul 2020 07:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ht+Xn13V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732013AbgG0O2T (ORCPT + 99 others); Mon, 27 Jul 2020 10:28:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:54258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732299AbgG0OYh (ORCPT ); Mon, 27 Jul 2020 10:24:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 070B721883; Mon, 27 Jul 2020 14:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859876; bh=uz4e4AJkJbVasdh38UWCAAdt40jCQWdvIqlGIDUj+yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ht+Xn13VwfDO9wGYlP5AxLyu6SYTZwkMSZK/7zB+sHEzzkpdxg1f6iV2xlkCQUjVo nt30RKx4aQiVavliVGvJ3ufqdupySOqvvupJ+3Qi90h4yLRY1AgseFLTVlusTzq6ib 5tQQZFA1f5qc7tqSa/oNSLfDkVxYIO0byvEY1tqU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot , syzbot , Tetsuo Handa , Michal Hocko , Todd Kjos , Christian Brauner Subject: [PATCH 5.7 139/179] binder: Dont use mmput() from shrinker function. Date: Mon, 27 Jul 2020 16:05:14 +0200 Message-Id: <20200727134939.407104892@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa commit f867c771f98891841c217fa8459244ed0dd28921 upstream. 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 a1b2289cef92ef0e ("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 Reported-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Michal Hocko Acked-by: Todd Kjos Acked-by: Christian Brauner Cc: stable Link: https://lore.kernel.org/r/4ba9adb2-43f5-2de0-22de-f6075c1fab50@i-love.sakura.ne.jp Signed-off-by: Greg Kroah-Hartman --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -947,7 +947,7 @@ enum lru_status binder_alloc_free_page(s trace_binder_unmap_user_end(alloc, index); } up_read(&mm->mmap_sem); - mmput(mm); + mmput_async(mm); trace_binder_unmap_kernel_start(alloc, index);