Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1343050ybh; Thu, 16 Jul 2020 09:31:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxI/eopP74iiNbq6Qfepbqb46EUFgltSWqgqsjTff6QhaQSH4zHeIzOHuAKhERBI9kFEAMQ X-Received: by 2002:a17:906:33c5:: with SMTP id w5mr4385053eja.275.1594917065923; Thu, 16 Jul 2020 09:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594917065; cv=none; d=google.com; s=arc-20160816; b=uakl3RWItOzLY1SAgH5KCcqieAeVvnaEejUKkaaS/ytWummrW9XtBDvHbajFCz8+Ox P6jbgxT9dxblgfODJ+YYQSeZN8aaf196QHKmADF22DdKUAom5DXHpDN9wQ3Hx/+Tx0vF QBg3EEfZfp69FYFO7JCsEvCxXkxWVQrQ3ykmSzG1kw9A8wADsSDsqaPxmt+wkLSVZPsQ oMIEQIZ2n89FgGsROFr4rdpM/hWACF9Uzumh55bDLjRyVHQNMhp3dLHPfwTLztGbZQQ7 4Q1JSAroe3FMDj9JDOw1hroghmWy2J1yS70/6VhYL4rwO4Q1q64JjeNjBOdd5ySuuQfo mBNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UBvZLFm8P38+9y6WR2KbXywMXD+3Z/02WBnT2MC+yco=; b=kexXeJoyzcM4QEsaRX55nK5o+kL6bxXY9pL3tmb4Mbewx+asN5vmwayCQz1TTsCLgN iqfaLGSUu4UYy29h4k9jaUtGl/WLpbymJyx5OHanePbJpgoUWHX9ZTahdVNnklR3ARIu 0Hgjs9i5mAsk+X+BF1gZ+Bh4jklOKP9b42SZBx57YA0K4zqAV3pAgsd+iAxHbB9IBeFO yc1JrEEhL+UPSuksBHw+JLne/O/PI2S16spJlW5eSiRCwH7/rpx0Y/oeyRMcOg6kj6yN 42NFwbRniNBgBCE2n60VCZPNHAl/jzOwu2T0ZRIPjazOC4inFpFXBGcEcCBwN+OQByCr +yoA== 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 f19si3380441ejh.568.2020.07.16.09.30.38; Thu, 16 Jul 2020 09:31:05 -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 S1729265AbgGPQ3n (ORCPT + 99 others); Thu, 16 Jul 2020 12:29:43 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:33338 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728845AbgGPQ3m (ORCPT ); Thu, 16 Jul 2020 12:29:42 -0400 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jw6lI-0001Zl-5G; Thu, 16 Jul 2020 16:29:32 +0000 Date: Thu, 16 Jul 2020 18:29:31 +0200 From: Christian Brauner To: Michal Hocko Cc: Tetsuo Handa , Greg Kroah-Hartman , Arve Hjonnevag , Todd Kjos , Martijn Coenen , Joel Fernandes , Christian Brauner , 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 Subject: Re: [PATCH v2] binder: Don't use mmput() from shrinker function. Message-ID: <20200716162931.g3delsp7qmfjup6x@wittgenstein> References: <0000000000001fbbb605aa805c9b@google.com> <5ce3ee90-333e-638d-ac8c-cd6d7ab7aa3b@I-love.SAKURA.ne.jp> <20200716083506.GA20915@dhcp22.suse.cz> <36db7016-98d6-2c6b-110b-b2481fd480ac@i-love.sakura.ne.jp> <20200716135445.GN31089@dhcp22.suse.cz> <4ba9adb2-43f5-2de0-22de-f6075c1fab50@i-love.sakura.ne.jp> <20200716151756.GO31089@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200716151756.GO31089@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 05:17:56PM +0200, Michal Hocko wrote: > On Fri 17-07-20 00:12:15, Tetsuo Handa wrote: > > 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 Thanks for the careful review Michal! Does this need a Cc: stable? Otherwise Acked-by: Christian Brauner Thanks! Christian