Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp819917ybh; Wed, 15 Jul 2020 16:40:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpLmziz+UDPxo48k/BWhi16OkDDmXfVM3E5ZAoMe8n71sUpXuY0SLG9DRk9w79Ic69Z4km X-Received: by 2002:a17:906:eb93:: with SMTP id mh19mr1240359ejb.552.1594856401921; Wed, 15 Jul 2020 16:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594856401; cv=none; d=google.com; s=arc-20160816; b=eggGfoAkDhtgYI8cVnGGyYniYmW5be9iKeFuD9oYEVddoSblSAO/EUE31t0YXVY6sN wizgAv/ek/yaSARpQUq8UD7p203j0RlizfZM21uOTakm71sPsQvTy0jJ8C06HooIoFg/ jJmBlMYUiZK8zRhBP6Ep3M8eJlSgnnTNWDumlRFByQxjH6//DKCNNBRd06Rghyz0LgKi pweHW4v6iPaIsAYjkxvwwl7f23I85t2tJhuSdbDya+DhyCPwcXDe/ELHyFsGgz86EPyY HyrkPUj58d/ug8Xw5fvfmKzbAvULU137YT8VmFeIxqAJYXGoEE9/7TusEiLCVZay4BSw S3bA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject; bh=KRZRysSHFtjkh7IgLYtvABc0e1415tRlTUIsFHVu1dE=; b=bRQ1EIPpfHY1/Lsn4r7sRT9q3BFZ/5HGRoyUknAPQRKD8lcjGgpXfBJxwIwvhf8qqT gLEd/tch+Gg0hN/J0iGAeVLFKUQvoabLo/AVtvmPJcHQAbg7sDHOs3rn8ryLmutidMaK MR93+1r8OcC1zb3Vb34V5psXFYFuEgTJI8lnO7LPgNQaIbt8JzCkDAQvjGue2dAOOxu9 0PFV2qVOOqWJDDE+/R0N0+j7DqAmWPL+r8qdZ6viaSUyHFrgxEI5fjVTHviQvXJ+r8XL NQFbetLGAjj5+zhNi/pQBNm+ZsSOaAJbYAjoM5fOIeuAD7CudaTrSt7ZkxMySrAvR/wA hexA== ARC-Authentication-Results: i=1; mx.google.com; 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 h6si2290377ejq.405.2020.07.15.16.39.38; Wed, 15 Jul 2020 16:40:01 -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; 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 S1726786AbgGOXg4 (ORCPT + 99 others); Wed, 15 Jul 2020 19:36:56 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:62153 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726770AbgGOXgz (ORCPT ); Wed, 15 Jul 2020 19:36:55 -0400 Received: from fsav108.sakura.ne.jp (fsav108.sakura.ne.jp [27.133.134.235]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 06FNas9G083247; Thu, 16 Jul 2020 08:36:54 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav108.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav108.sakura.ne.jp); Thu, 16 Jul 2020 08:36:54 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav108.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 06FNarZT083239 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Jul 2020 08:36:54 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: [PATCH] binder: Don't use mmput() from shrinker function. To: Greg Kroah-Hartman , Arve Hjonnevag , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , Michal Hocko References: <0000000000001fbbb605aa805c9b@google.com> Cc: syzbot , acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, mark.rutland@arm.com, mingo@redhat.com, namhyung@kernel.org, peterz@infradead.org, syzkaller-bugs@googlegroups.com, "open list:ANDROID DRIVERS" , linux-mm From: Tetsuo Handa Message-ID: <5ce3ee90-333e-638d-ac8c-cd6d7ab7aa3b@I-love.SAKURA.ne.jp> Date: Thu, 16 Jul 2020 08:36:52 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <0000000000001fbbb605aa805c9b@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syzbot is reporting that mmput() from shrinker function has a risk of deadlock [1]. Don't start synchronous teardown of mm when called from shrinker function. [1] https://syzkaller.appspot.com/bug?id=bc9e7303f537c41b2b0cc2dfcea3fc42964c2d45 Reported-by: syzbot Reported-by: syzbot Signed-off-by: Tetsuo Handa --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 42c672f1584e..cbe6aa77d50d 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -947,7 +947,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item, trace_binder_unmap_user_end(alloc, index); } mmap_read_unlock(mm); - mmput(mm); + mmput_async(mm); trace_binder_unmap_kernel_start(alloc, index); -- 2.18.4