Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1792187ybi; Wed, 3 Jul 2019 23:30:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdia+I7sVA4TY1GYRwDlJsiJk6wKsHa/i9jwfLG8/zk1hsINtvgwRW6ZsryRngd7aImXVd X-Received: by 2002:a17:902:9a06:: with SMTP id v6mr46422886plp.71.1562221857465; Wed, 03 Jul 2019 23:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562221857; cv=none; d=google.com; s=arc-20160816; b=W/0WCdueDbHO2uKVGXqhJj3fDAgEsQhcjiaQiGRUdrpQ8Zco22EA/FsfRdQJZZIVG8 ZUbPELATgq+bLRtwjp96jvb+baWkjCG5C+pYn9OYDx26ZpnEwZ3viWHCF+eMX9rndBx9 yKJdaEJ9V3R0ICSbJGkXqQGgSWd7i4jl5gAx+HhIXX2hTi+Cu7h/6hah9mQxpjGhtIwf O765mTTD4175FcqNy8E4MD9PJ3Nfk3mPnROJA8stC0r3GdIIkvc3xFj5BkFCcOsF6H+N QnoVg+jadCTqttZ5EmYLJuRNQEr2HxfFUadobi0oii0DlimZZxKgo/rUcW400caM8guO B5SQ== 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=5I7M83PoJQwZKyj3WNOYeCYjOCFvjCi3GwLKdY4Qqb0=; b=d4APb+obt9vMeohSAT1+x0CBLTOIJ1OB0tgwQtrHcV2c2jqJfAkJuHn21o2fp0O16D apxXXylvW+Eb0aNah0Fu/AA9y9kGwlwn96VnFh0wkr4dvwf3OLpKsThBvSEQwH7JFU7Z 6PMrFXJUKCexe8ZDkJdCXx3cYPvB9RdjyRvMOdJIxXb2RDw3aHym/AFXnKZfquisz3Es a42honYRRy4OBWX1GkUvLhB2uzd82X2O4Iu11xtCWRHOFE8iRCHmzCAiL2As3pDUK4ch agC6iICYFzTO/jb8qj0ONIdO4fLzy6LBm7TdNKHszmgRmpkFQQg55bra6RKgLlHmA6jw 4Xgg== 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 j124si4950123pfb.151.2019.07.03.23.30.42; Wed, 03 Jul 2019 23:30:57 -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 S1727211AbfGDG3b (ORCPT + 99 others); Thu, 4 Jul 2019 02:29:31 -0400 Received: from gate.crashing.org ([63.228.1.57]:51559 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGDG3b (ORCPT ); Thu, 4 Jul 2019 02:29:31 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x646TNhK025563; Thu, 4 Jul 2019 01:29:24 -0500 Message-ID: Subject: Re: [PATCH v4 OPT2] driver core: Fix use-after-free and double free on glue directory From: Benjamin Herrenschmidt To: Greg KH Cc: Muchun Song , rafael@kernel.org, prsood@codeaurora.org, mojha@codeaurora.org, gkohli@codeaurora.org, linux-kernel@vger.kernel.org Date: Thu, 04 Jul 2019 16:29:23 +1000 In-Reply-To: <20190704054058.GC347@kroah.com> References: <20190626144021.7249-1-smuchun@gmail.com> <20190703193606.GA8452@kroah.com> <319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org> <20190704054058.GC347@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: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-07-04 at 07:40 +0200, Greg KH wrote: > On Thu, Jul 04, 2019 at 08:57:13AM +1000, Benjamin Herrenschmidt > wrote: > > On Wed, 2019-07-03 at 21:36 +0200, Greg KH wrote: > > > > > > > -static struct kobject *get_device_parent(struct device *dev, > > > > - struct device *parent) > > > > +/** > > > > + * __get_device_parent() - Get the parent device kobject. > > > > + * @dev: Pointer to the device structure. > > > > + * @parent: Pointer to the parent device structure. > > > > + * @lock: When we live in a glue directory, should we hold the > > > > + * gdp_mutex lock when this function returns? If @lock > > > > + * is true, this function returns with the gdp_mutex > > > > + * holed. Otherwise it will not. > > > > > > Ugh, if you are trying to get me to hate one version of these > > > patches, > > > this is how you do it :) > > > > > > A function should not "sometimes takes a lock, sometimes does > > > not, > > > depending on a parameter passed into it" That way lies > > > madness... > > > > Yes, I prefer this approach to the fix but I dont like the patch > > either > > for the same reason... > > > > ... > > > > > Anyway, this is a mess. > > > > > > Ugh I hate glue dirs... > > > > Amen... > > Well, can we just remove them? Who relies on them anymore? Isn't it an ABI ? I'm sure there are going to be userspace things that break if we do... Cheers, Ben.