From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91F64C48BD5 for ; Wed, 26 Jun 2019 00:56:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B8E5208CA for ; Wed, 26 Jun 2019 00:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561510609; bh=IEdgHhVzO/KXfl1rhl0JQGR+FXQJwlwYb+hfIotRyw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=oCztx5vwnM/4VabGdsO3s4UxFY2FoQ/2CDhmelP78WJfvt3sXRNNUy9j0KevUX+W9 t1ipev7jvsfS2y2W+ttMi0ieEq3l5BoW154wa/xf5Zon5iYYeKiuMfXQ63avjlEjDq 76DtuJehkH33tDI+mB+l6EzIriPozpmpEIXpgtRo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbfFZA4s (ORCPT ); Tue, 25 Jun 2019 20:56:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:33128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726443AbfFZA4s (ORCPT ); Tue, 25 Jun 2019 20:56:48 -0400 Received: from localhost (unknown [172.104.248.44]) (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 63D47208E3; Wed, 26 Jun 2019 00:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561510607; bh=IEdgHhVzO/KXfl1rhl0JQGR+FXQJwlwYb+hfIotRyw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OhyEESFkeURnMcVE7e+cjQoAuBwJalH3DtvaFQF6w5ZQwd6ohSqVQL+Z90iZ4CYoh bHHhX0ZUlxZo+KJ/YPDB1kvkZZU5HwHvBn/yDQRuUnPpzUITcW3M7S3+zD8Gc3GwgG IN6nZktvwZEW7/nALQ9AovCkj94cO3cOZ7Qi/EKs= Date: Wed, 26 Jun 2019 08:55:05 +0800 From: Greg KH To: Benjamin Herrenschmidt Cc: Muchun Song , "Rafael J. Wysocki" , Prateek Sood , Mukesh Ojha , gkohli@codeaurora.org, linux-kernel , linux-arm-msm , zhaowuyun@wingtech.com Subject: Re: [PATCH v4] driver core: Fix use-after-free and double free on glue directory Message-ID: <20190626005505.GD21530@kroah.com> References: <20190516142342.28019-1-smuchun@gmail.com> <20190524190443.GB29565@kroah.com> <20190618152859.GB1912@kroah.com> <20190618161340.GA13983@kroah.com> 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.12.1 (2019-06-15) Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Wed, Jun 26, 2019 at 08:56:00AM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2019-06-25 at 23:06 +0800, Muchun Song wrote: > > Benjamin Herrenschmidt 于2019年6月19日周三 > > 上午5:51写道: > > > > > > On Tue, 2019-06-18 at 18:13 +0200, Greg KH wrote: > > > > > > > > Again, I am totally confused and do not see a patch in an email > > > > that > > > > I > > > > can apply... > > > > > > > > Someone needs to get people to agree here... > > > > > > I think he was hoping you would chose which solution you prefered > > > here > > > > Yeah, right, I am hoping you would chose which solution you prefered > > here. > > Thanks. > > > > > :-) His original or the one I suggested instead. I don't think > > > there's > > > anybody else with understanding of sysfs guts around to form an > > > opinion. > > > > > Muchun, I don't think Greg still has the previous emails. He deals with > too much to keep track of old stuff. > > Can you send both patches tagged as [OPT1] and [OPT2] along with a > comment in one go so Greg can see both and decide ? That would be wonderful, thank you as I can't really find the "latest" versions of both options. > I think looking at the refcount is fragile, I might be wrong, but I > think it mostly paper over the root of the problem which is the fact > that the lock isn't taken accross both operations, thus exposing the > race. But I'm happy if Greg prefers your approach as long as it's > fixed. I'll look at them and try to figure this out next week, thanks. greg k-h