Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp34673ybd; Tue, 25 Jun 2019 15:58:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy08w0fJMYI/yIYhlszzXwoh9lumSq7/TiwxJI4oLIL/hLtTSn2ePlhSOlwRKsrOAmab6TY X-Received: by 2002:a63:a48:: with SMTP id z8mr41231089pgk.91.1561503518837; Tue, 25 Jun 2019 15:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561503518; cv=none; d=google.com; s=arc-20160816; b=W3xHiGMvGWaZM3vLHhAQHkxP3/1+T0yHWg+g4bKf5JS9ot5SqWZa0bsMCIqcMUUqor 5WXb7ei+1R9VU3WzdXQvu1fbAA1PicD0qNridZCagkhNR6sJIRQulC8g/1B+1wUDT989 PNuV4pod1hzukjai0nEjj9DjPCcB5VPB8nSKx/KgK1YlnHUQmnySQRv3ZxZv5Ytryzl2 s0q3TcFOxQizmTHAmwbCsaJE4Qkeq1iVP7ZWESc5lNPhVtmINi8uyQLhV+mITHYC6nAN HaV33mERhqB2+gF5i8V/mQgvjw9YGW7cVX8Zfna7C/PtGamBFcavy/zfwMUARKOapr3Y L/1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=LK1gMp+TE6SgpwT7YdEfgvSOahIDlYJueyK15YHorkQ=; b=PSBEkmLmqXqGnJCoHbXQNeA0flD3ecMhEnmm3ZPFt3u7+KEeEJ9EpMBGQ+sfXW7MRF 4OvwrFiRfc1ll5HJzy34pYEJ79/7Y3Q1C3iv0oLI9k1GsymmoE3O6gXFTWmnH27XOXqQ 6LSFl1F0TKQ1t501EDqWbwHYQ4gxQcTr571kOQk4pz0ZL6nxBDJBAuv6HwyN3YHcMIvD jsVGnqOnIhks/h+sLH9FFqdmGP/n4Y9+fjVOkLbiUOpSBsrcZ/t7mKD1XeKc9DDi3saW dFTo8408ouzcXgjI/7P/QYAjoZM+sApbuj5gQgSBA+OXAM5EPXLpbuu9thNJq9UuN1yY Pi1A== ARC-Authentication-Results: i=1; mx.google.com; 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 k193si14779518pgc.473.2019.06.25.15.58.22; Tue, 25 Jun 2019 15:58:38 -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; 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 S1726382AbfFYW4L (ORCPT + 99 others); Tue, 25 Jun 2019 18:56:11 -0400 Received: from gate.crashing.org ([63.228.1.57]:48041 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725782AbfFYW4L (ORCPT ); Tue, 25 Jun 2019 18:56:11 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5PMu1jN032528; Tue, 25 Jun 2019 17:56:02 -0500 Message-ID: Subject: Re: [PATCH v4] driver core: Fix use-after-free and double free on glue directory From: Benjamin Herrenschmidt To: Muchun Song , Greg KH Cc: "Rafael J. Wysocki" , Prateek Sood , Mukesh Ojha , gkohli@codeaurora.org, linux-kernel , linux-arm-msm , zhaowuyun@wingtech.com Date: Wed, 26 Jun 2019 08:56:00 +1000 In-Reply-To: References: <20190516142342.28019-1-smuchun@gmail.com> <20190524190443.GB29565@kroah.com> <20190618152859.GB1912@kroah.com> <20190618161340.GA13983@kroah.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? 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. Cheers, Ben.