Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4272069ybp; Mon, 14 Oct 2019 01:50:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3KtQBn4ITl8r+Ji6nr9NB8Jarw7og+GyvVx3pumbfen2zRqzb+S8ytDPu9LHwSDz52rZh X-Received: by 2002:a50:ec8f:: with SMTP id e15mr26665935edr.106.1571043022415; Mon, 14 Oct 2019 01:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571043022; cv=none; d=google.com; s=arc-20160816; b=Hf1IpaAZm5ILI36sXXQTT8rnxk9a8NPj8mFRR8iclUMpzV8wB74pGxhRlFPPkqS0yB s7Ac5lYfpDRiShPBdVT2mpDbcBVDNUarWpf8dwsWCQQjSO2wZBAwSPvrW5ACASrZClJz zT1tK7KnqzXmeOAsrqeXPIQAA5LZmgeuhvnhYBcbgWjyCPc9qSVEn0vkK8lCZ85J3m6h Rq9jbNAu54aj2mEgQLU++GlaJy/0aoeWFzbNe8Ap7NXNyBjE9cTlb3WwunOQxsbKMstv 2WFC0+SfDOEziX9xOLfMO2ilaknqBeBI6h01VlwDCk4xgMhNDFhTQfYb9XJw+xNvdtFc ZcFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=xtv8eDUo7LGL8wXNVViezHRuz1eIYtvj8JrfIGcZVug=; b=eOmklAJtcI/uESCOlUkH1YYEHaFt44HNMTguskJC+xlCFquKokjYfjT2YuY7MhbWSF CUNWqTmmUSTMBNVOtUBhFly+MY6/bfZ/tcVySMaDFVZroj5Ye109bdb8s3FkrqMt0AoX vzeyZm/ZAWH+hXmJkZkwOsyAzdGaYrvPCoNtm82rQWj4ZZn16/GfAuC315JopRac8tXE l9Np4Q+ZEKEtpj4C1aXUio2FuXSv2JBiztqy1WjP516gHuNYGnHPVVYKpPRd/dAR5OK9 eidhMyT9CNzUmW5y78VwNYSgwE+t7YZ34UliwQWIH6hkA9sRRRojx5geb/l06yMuwhC/ qycQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=HrE4MoWh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si11018734edq.264.2019.10.14.01.49.59; Mon, 14 Oct 2019 01:50:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=HrE4MoWh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730573AbfJNIsx (ORCPT + 99 others); Mon, 14 Oct 2019 04:48:53 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46428 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730464AbfJNIsw (ORCPT ); Mon, 14 Oct 2019 04:48:52 -0400 Received: by mail-ed1-f67.google.com with SMTP id r18so2396726eds.13 for ; Mon, 14 Oct 2019 01:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=xtv8eDUo7LGL8wXNVViezHRuz1eIYtvj8JrfIGcZVug=; b=HrE4MoWhmtc/2ksDE63nOcfdOtX17WLrOzhRQ9QxIpfLhDYJ37xkcRCjeilpHPQbY/ a9VXf8/BQDX+xVYBdbQxwqJg/4C0nxCllPh4PXFjE6krWeWUAUVaKgU8hoVw1CcGNRUj havuz7CsORrPqD7MmaYvGtD/MPGCN3gWB5HRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=xtv8eDUo7LGL8wXNVViezHRuz1eIYtvj8JrfIGcZVug=; b=ETmUQvxV5/hiJ5W/s5NpqGO8lHqI7ajaiTDZGEWAHGsSYLxqoE7sR23IWATujJGFwN PE4F4n5deIngUaKS2r9LkKEWRjtOx2pWrVFt3YXJAFZfoHQLdvMiQpyCpfxmXOnv0DF9 HFVujb1W8TeZmDBMJSHs86KYadMEbzJUOUUrI0W8TDGqlVPoftMFPkuCsGDnVSCObqrV /TPKbs4+uvurRGh/LPikyipTezNb/fm56Shd8RctK2vsUQ8M6/QRbTGIR9dVX2dcFshz Am583vDJp8rPfJIvaaxltokcUZjRNtYfbsxeyYdvzFIUATnsp7+UCrF5N88CfuZqwzFx BYlA== X-Gm-Message-State: APjAAAXDuT5YCzkze6Sp4dgENtfp0XxbZ40L4k2D1Ib27yQVk7FvJ7zR mMCGDnepcUjC+y0GIiB5kGPEAQ== X-Received: by 2002:a17:906:309b:: with SMTP id 27mr27115276ejv.243.1571042930920; Mon, 14 Oct 2019 01:48:50 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id bq13sm2215123ejb.25.2019.10.14.01.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 01:48:50 -0700 (PDT) Date: Mon, 14 Oct 2019 10:48:47 +0200 From: Daniel Vetter To: Johan Hovold Cc: Daniel Vetter , Rob Clark , Sean Paul , Fabien Dessenne , Mauro Carvalho Chehab , Harald Freudenberger , David Airlie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Greg Kroah-Hartman , Al Viro Subject: Re: [PATCH 0/4] treewide: fix interrupted release Message-ID: <20191014084847.GD11828@phenom.ffwll.local> Mail-Followup-To: Johan Hovold , Rob Clark , Sean Paul , Fabien Dessenne , Mauro Carvalho Chehab , Harald Freudenberger , David Airlie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Greg Kroah-Hartman , Al Viro References: <20191010131333.23635-1-johan@kernel.org> <20191010135043.GA16989@phenom.ffwll.local> <20191011093633.GD27819@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191011093633.GD27819@localhost> X-Operating-System: Linux phenom 5.2.0-2-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 11, 2019 at 11:36:33AM +0200, Johan Hovold wrote: > On Thu, Oct 10, 2019 at 03:50:43PM +0200, Daniel Vetter wrote: > > On Thu, Oct 10, 2019 at 03:13:29PM +0200, Johan Hovold wrote: > > > Two old USB drivers had a bug in them which could lead to memory leaks > > > if an interrupted process raced with a disconnect event. > > > > > > Turns out we had a few more driver in other subsystems with the same > > > kind of bug in them. > > > Random funny idea: Could we do some debug annotations (akin to > > might_sleep) that splats when you might_sleep_interruptible somewhere > > where interruptible sleeps are generally a bad idea? Like in > > fops->release? > > There's nothing wrong with interruptible sleep in fops->release per se, > it's just that drivers cannot return -ERESTARTSYS and friends and expect > to be called again later. Do you have a legit usecase for interruptible sleeps in fops->release? I'm not even sure killable is legit in there, since it's an fd, not a process context ... > The return value from release() is ignored by vfs, and adding a splat in > __fput() to catch these buggy drivers might be overkill. Ime once you have a handful of instances of a broken pattern, creating a check for it (under a debug option only ofc) is very much justified. Otherwise they just come back to life like the undead, all the time. And there's a _lot_ of fops->release callbacks in the kernel. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch