Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp598331yba; Sat, 4 May 2019 08:42:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzoKTTRmmGmI5vJsb8IQZkDyAAJDJaxvjecfTZMy+eTV9AgB0H+3oA0SK8DbH3J5QT9sFx5 X-Received: by 2002:a17:902:bb97:: with SMTP id m23mr19669604pls.155.1556984525480; Sat, 04 May 2019 08:42:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556984525; cv=none; d=google.com; s=arc-20160816; b=IsTPpdYicB/HrbFtQdUQ+hXYekgZxvrsQAGCaVq6/y4uZOELAvyTbROb+Jmn2HxLsn N3WO25vPTyCGELUMsxUWTJyF5HSF9cPglsmI8hBPzoSOiMX3an2AnfzhVEYERH6icgv3 P9t/a77e9yzSfgMQIqMCxg/XFqS8AEMOItNqF+t/DbTyTetn8rSS86cdwicRdokEhhF0 VwgaDttsXqcAZkTOWTGVRD2ajlG2Tijg1n9+sAtMWIgPz8bfViubymMx1Yqld2dr2KDJ mVZjEqhGTcxnhTPqJILnergAkUS7L8nhOSCk3Khuj36QKDgTrkTqzhDWXIABA9S90zRW Au9A== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X1s8qPzcA1ZEOmE7AcCwSwLsMv9D9I8AblFgA3cuLIM=; b=omE20vqr0+pRlf5NZcMmtd+5RgNWu6YPhcp0gIDb2SboopHsYI6ZgctibqHgdmNhM4 jJaFEufoQKxOuGKX0AqP7gMxzYLbLIXTqpPKO2kRFLGHPRsSHouvZQHorzqX+V/BqW4z pqdtEQOkld7iEG1Ul1VejyRsaoH1WI5z4PiT1M4qrAo3Qg71YTbIGb4kQ9mcVqbdNV0h eqMcu8gVxrqkkBX1vr00ccK1AxnkcAq35nFtyuPuDnlsWNkO4oLM1CkP7e0V0DN+P4YB AoaGIOqlO3jh2v4B1mgxsYS4Mt7B+z4ucSKiP/DuMObN2xbpX+FMtKxnDxW7Qj0e/Hyr oa0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SEpoWxJn; 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 p2si7505372pgk.326.2019.05.04.08.41.21; Sat, 04 May 2019 08:42:05 -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=pass header.i=@kernel.org header.s=default header.b=SEpoWxJn; 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 S1726714AbfEDPen (ORCPT + 99 others); Sat, 4 May 2019 11:34:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:51316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDPen (ORCPT ); Sat, 4 May 2019 11:34:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F61120644; Sat, 4 May 2019 15:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556984082; bh=XB+2ke+O8ycEXrjtGw3aam7SL9GBf1WhXYl7lNP9HoY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SEpoWxJnTRmyiQg0gX9C6izeET8Mc5tzrOIXV9bD8L+VNvtoDSozHid9xk/Vtop3x GiZfuNzyH8fhFvKAfaWaAI/CBjgDEJ2FIehuU2RHZB7m+j2ap1q+Wuv5Ju0T6YL136 Fqf2FC8gZ2SGbiDFsGOtHq7wDX7zyAzEa6s95I1k= Date: Sat, 4 May 2019 17:34:40 +0200 From: Greg KH To: Muchun Song Cc: rafael@kernel.org, Benjamin Herrenschmidt , linux-kernel , zhaowuyun@wingtech.com Subject: Re: [PATCH] driver core: Fix use-after-free and double free on glue directory Message-ID: <20190504153440.GB19654@kroah.com> References: <20190423143258.96706-1-smuchun@gmail.com> <24b0fff3775147c04b006282727d94fea7f408b4.camel@kernel.crashing.org> <79fbc203bc9fa09d88ab2c4bff8635be4c293d49.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 04, 2019 at 10:47:07PM +0800, Muchun Song wrote: > Benjamin Herrenschmidt 于2019年5月2日周四 下午2:25写道: > > > > > The basic idea yes, the whole bool *locked is horrid though. > > > > Wouldn't it > > > > work to have a get_device_parent_locked that always returns with > > > > the mutex held, > > > > or just move the mutex to the caller or something simpler like this > > > > ? > > > > > > > > > > Greg and Rafael, do you have any suggestions for this? Or you also > > > agree with Ben? > > > > Ping guys ? This is worth fixing... > > I also agree with you. But Greg and Rafael seem to be high latency right now. It's in my list of patches to get to, sorry, hopefully will dig out of that next week with the buffer that the merge window provides me. thanks, greg k-h