From patchwork Wed Jul 15 23:36:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 11666433 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2BDA8138C for ; Wed, 15 Jul 2020 23:37:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ECAEF20656 for ; Wed, 15 Jul 2020 23:37:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECAEF20656 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E59296B0007; Wed, 15 Jul 2020 19:37:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E0A0B6B000A; Wed, 15 Jul 2020 19:37:33 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D46A36B000C; Wed, 15 Jul 2020 19:37:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id BFD6B6B0007 for ; Wed, 15 Jul 2020 19:37:33 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 44F57181AC9BF for ; Wed, 15 Jul 2020 23:37:33 +0000 (UTC) X-FDA: 77041924386.26.duck22_3c0b76826efd Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 1F7571804B65A for ; Wed, 15 Jul 2020 23:37:33 +0000 (UTC) X-Spam-Summary: 1,0,0,396528d2a861bbe0,d41d8cd98f00b204,penguin-kernel@i-love.sakura.ne.jp,,RULES_HIT:41:152:355:379:854:960:966:967:973:988:989:1260:1261:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1568:1593:1594:1711:1714:1730:1747:1777:1792:2196:2199:2393:2525:2559:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3866:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4385:5007:6261:6742:7652:7903:9025:10004:10400:11026:11658:11914:12043:12048:12296:12297:12438:12517:12519:12523:12532:12555:12760:12895:13069:13075:13221:13229:13311:13357:14096:14097:14181:14394:14721:21080:21365:21451:21627:30054,0,RBL:202.181.97.72:@i-love.sakura.ne.jp:.lbl8.mailshell.net-62.14.10.100 64.201.201.201;04ygjbqfw9i1d36srhh1gzpbamyx1ypk8pqiqps41canskdymhc3dowt9hb1gxf.34miqnge8oaprw741c9g4ezn6nphwucy97njzewh986cax5toiak8omwcdiysxb.h-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,M SF:not b X-HE-Tag: duck22_3c0b76826efd X-Filterd-Recvd-Size: 3337 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jul 2020 23:37:31 +0000 (UTC) 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-Language: en-US X-Rspamd-Queue-Id: 1F7571804B65A X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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);