Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp122921ybd; Tue, 25 Jun 2019 17:59:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNX+y2bIa59I+4q9F1o17BM5i2+eaOi1/Z6IeE1wX5p4LucA3VinrDYz1ANSTDZGdcq8/o X-Received: by 2002:a17:90a:bb0c:: with SMTP id u12mr928789pjr.132.1561510773562; Tue, 25 Jun 2019 17:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561510773; cv=none; d=google.com; s=arc-20160816; b=T5dMgrDET9dNJjktJ3fypJ93yfD2xv51LjO1GOrGfxvrEkmzwHJGTbrWlOWirPsoRs iABoQJPWWFgFsrdTmMjPU77W3OvF3MD7gTKoOJ5ktELfMJu5dVbTLlOv7vlUB3lIJUHS AyWoJ+odQ37Ul4wzYN9xR9CfRyRnFAug9GymkEqAnfC8/aPuAW+z36wnMhHSeUq0DOyo NctuaLC82FmmsCO/a9cfgPT/+Q1zRX5QOJTcPshZqfKLyP9KdsQo+Pjwkb3yd+IjAVbu RF4JRV033RBjBbw7uzOREkfTaRrUDEpDhGE5QH65KaWysheN1C4sgqAFf9ZhXL+DiINn u2RA== 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=AbmsEuNdDV4OhmqXtEpu5YBRr1OtQNtnAdx2lpy/mY4=; b=CgcVUJzsAQkOvpeMEo8lnTQHi5ipHVUFk6xKhSpBCz5EodyHPCUYwcHM7dygWrtWVb saZd3OC5OwGEuBn3+zJnbrbezkcgtgUqOsQCIUtTzaI0H1Re+m2naC3Wkdk+0k725hOR +jKsS7a+/0PlJKnDbKXte63gnJzHDV35d8a9ymOfdlAw3qhaf4gS9OtclCGpjCKbk2Xd Ye2WDjiK0htvOjdyHh12+UfWUOyKq2VcUo1/yUr123Q4f2E8+hOCbucFD/4t4BfOEUVv Ptenr53idlIixTci9XHffo+rsYiTIe1ovrnX+ddZKOx5+gCS8NGuau+eEGKxYY81VGsi xzKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OhyEESFk; 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 m10si385304pjl.77.2019.06.25.17.59.16; Tue, 25 Jun 2019 17:59:33 -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=OhyEESFk; 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 S1726480AbfFZA4t (ORCPT + 99 others); Tue, 25 Jun 2019 20:56:49 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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