Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp745209ybc; Tue, 12 Nov 2019 08:33:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwwzucZXniwF13xF8fu7TtVNcMlJg3WOTyU4KZuqeSooTJAuotFn8OSfDdzL5c6xPdVtoJO X-Received: by 2002:aa7:d344:: with SMTP id m4mr21035678edr.270.1573576418779; Tue, 12 Nov 2019 08:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573576418; cv=none; d=google.com; s=arc-20160816; b=XyrDBSPBmtv/5qJpkX9WVgTwfwDd1bowl4cnE64me1gPPmPxXfe17TODoGsbIvfKf8 vTRZ9kRbzzP+3alb22Hif9WDzEG9G0v6d5mg6ZPWdujd4H8s47yIJX+M5WCRJhJenq3M /9aLmjg0JKtENOivglhUXYLrLCLcUrMttOGezl3lI7fWOl1XBACfXCzAS4Am6Boq/b28 kF2dvVjJvIYCqNgJOhtSzfEaGu0j3uTOkQZaY56lSzLn+4S3duCfSgrMp02fOcWf+pUh ghnU7ZUv3TVKH7/RaDYyHu6d1Ry0vp3b05H+bZ2Mo2FmWxjL+aSnDZJVORRPx+oukySh p6Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=e2Jz3E/qC25NF9IiKUouiFwK/DvFsp3VH/99djW83Tw=; b=bziM3VgPJ6nz/OI/35gvopSpo3YyQ4xpaiEMv1qq2LTp7nhDltmeUnJQ22KmYCPg6k +cP4uo1/xoMgjLyfkLEeQCadpKM/485+5y56xNohHfvkMU8ZPtNUgVUFb/FiU75uc3Ts dMtkqy4qXlVOFT2KdtxY1rOfd/22wmfFhGOwo/SnXYCCZh/w4xn3JhjvpU1hEdNwAIC/ w5zzEKtPmwIWv1F0RkM8U8GD6E1XRaF7IBa+Fu+own9uu4Liy5qOWp4FUbMrW6Rpdip2 3Gq6oD8UzE/hpbXF+kp6DhwyarU27UeGsJGt4kyk30CCI2c8jFyexRORDtlxCf5swjbF LtzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="juR6/t7s"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15si13080803edb.81.2019.11.12.08.33.13; Tue, 12 Nov 2019 08:33:38 -0800 (PST) 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=pass header.i=@gmail.com header.s=20161025 header.b="juR6/t7s"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727275AbfKLQcV (ORCPT + 99 others); Tue, 12 Nov 2019 11:32:21 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:41606 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726799AbfKLQcV (ORCPT ); Tue, 12 Nov 2019 11:32:21 -0500 Received: by mail-ed1-f67.google.com with SMTP id a21so15417908edj.8; Tue, 12 Nov 2019 08:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e2Jz3E/qC25NF9IiKUouiFwK/DvFsp3VH/99djW83Tw=; b=juR6/t7s9JzCUry7/6lTMFF27i/rneVimIPKY2HgzFAnMiFuV1WmO2ww+Pj8PdVbej qP6gfhPakJK4d6SPvlUeYiQWRLeOka1T5sxZZLeaLfpdnYbQ46HBKD5amyqCU6c8u5nW m9YuvO9yG5zyNdHia7jl93PojR4QMnOZj/9qK/h2bw+OdnE5vgw/8B95LZ5HFdCvF500 K9rOVtrRpx3vVI/iVCupSf21kBaSLBnRbBJdWNbM+WjxE8v33s1/0LZU/1bkbih/Uvk1 H56RFOj2/JCuZqeW0hNsE0Gci+GtOe0ILTaF4vIDij05gs6AXmjaeyVB4RgsjMf+3uQh yXkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e2Jz3E/qC25NF9IiKUouiFwK/DvFsp3VH/99djW83Tw=; b=tBvbb2PAXL/CevqviHs6GcibHgRUuo7bdMjJBRNLPcsO4RuBoDdeq4biQsUj8Oulmr vIZaW+xm437l6iKVQF6+YGGw5t9AaqshMlNMBT4GDf+HWDRp8Q95jC9uFDoidkGlmUyZ Kw/97pjzy6P3dxHVJpD2D+SS5DUirlaaBegvZN8B2QtbEEwDWhrEWgwG7AHWgExO1dgZ Gh6t5V669STraYmo5PHOz7wpytzfuZV9DNi7s8daZQ3hNHej8OxUerNcwdODYVuBs0kd WxvMc8zUA84UA8It+bIsAs9TWb4uEslBL1UzND9nd8daaMN20lpmI4eFn6uTSgV61liC YDew== X-Gm-Message-State: APjAAAXI6InRXONHPE0zbKQnwVtv6POTfm94xYG9CzGhovIPknsA3Hm4 Twd+9E5c5CakRmXiFyCWvGjgL9MytIWMIDNEkpQBkhj2 X-Received: by 2002:a17:906:73d5:: with SMTP id n21mr29350021ejl.228.1573576338515; Tue, 12 Nov 2019 08:32:18 -0800 (PST) MIME-Version: 1.0 References: <20191010131333.23635-1-johan@kernel.org> <20191010131333.23635-2-johan@kernel.org> <20191030100146.GC4691@localhost> <20191112104001.GP11035@localhost> <20191112140155.GJ23790@phenom.ffwll.local> In-Reply-To: <20191112140155.GJ23790@phenom.ffwll.local> From: Rob Clark Date: Tue, 12 Nov 2019 08:32:07 -0800 Message-ID: Subject: Re: [PATCH 1/4] drm/msm: fix memleak on release To: Daniel Vetter Cc: Johan Hovold , Sean Paul , David Airlie , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , linux-arm-msm , dri-devel , freedreno , Linux Kernel Mailing List , linux-media@vger.kernel.org, linux-s390@vger.kernel.org, Greg Kroah-Hartman , stable , Jordan Crouse , Harald Freudenberger , Mauro Carvalho Chehab , Fabien Dessenne , Dave Airlie Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 12, 2019 at 6:01 AM Daniel Vetter wrote: > > On Tue, Nov 12, 2019 at 11:40:01AM +0100, Johan Hovold wrote: > > On Wed, Oct 30, 2019 at 11:01:46AM +0100, Johan Hovold wrote: > > > On Thu, Oct 10, 2019 at 03:13:30PM +0200, Johan Hovold wrote: > > > > If a process is interrupted while accessing the "gpu" debugfs file and > > > > the drm device struct_mutex is contended, release() could return early > > > > and fail to free related resources. > > > > > > > > Note that the return value from release() is ignored. > > > > > > > > Fixes: 4f776f4511c7 ("drm/msm/gpu: Convert the GPU show function to use the GPU state") > > > > Cc: stable # 4.18 > > > > Cc: Jordan Crouse > > > > Cc: Rob Clark > > > > Signed-off-by: Johan Hovold > > > > --- > > > > > > Rob, Sean, > > > > > > Sending a reminder about this one, which is not yet in linux-next. > > > > > > Perhaps Daniel can pick it up otherwise? > > > > Another two weeks, another reminder. This one is still not in -next. > > Well msm is maintained in a separate tree, so the usual group maintainer > fallback for when patches are stuck doesn't apply. oh, sorry, this wasn't showing up in patchwork.. or rather it did but the non-msm related series subject made me overlook it. I've already sent a PR, but this shouldn't conflict with anything and I think it can go in via drm-misc/fixes Reviewed-by: Rob Clark > Rob, Sean, time to reconsider drm-misc for msm? I think there's some more > oddball patches that occasionally get stuck for msm ... > > Also +Dave. > -Daniel > > > > > Johan > > > > > > drivers/gpu/drm/msm/msm_debugfs.c | 6 +----- > > > > 1 file changed, 1 insertion(+), 5 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c > > > > index 6be879578140..1c74381a4fc9 100644 > > > > --- a/drivers/gpu/drm/msm/msm_debugfs.c > > > > +++ b/drivers/gpu/drm/msm/msm_debugfs.c > > > > @@ -47,12 +47,8 @@ static int msm_gpu_release(struct inode *inode, struct file *file) > > > > struct msm_gpu_show_priv *show_priv = m->private; > > > > struct msm_drm_private *priv = show_priv->dev->dev_private; > > > > struct msm_gpu *gpu = priv->gpu; > > > > - int ret; > > > > - > > > > - ret = mutex_lock_interruptible(&show_priv->dev->struct_mutex); > > > > - if (ret) > > > > - return ret; > > > > > > > > + mutex_lock(&show_priv->dev->struct_mutex); > > > > gpu->funcs->gpu_state_put(show_priv->state); > > > > mutex_unlock(&show_priv->dev->struct_mutex); > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch