Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1747416ybi; Wed, 3 Jul 2019 22:41:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqz955IlxmhdfnRKyYjKvaOYDARpYSsW22MTVKQ//9NipCY4gRB5J32DJVsbRxeYGASHIExo X-Received: by 2002:a63:e001:: with SMTP id e1mr41787985pgh.306.1562218909492; Wed, 03 Jul 2019 22:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562218909; cv=none; d=google.com; s=arc-20160816; b=sg81z0t5sxjN4IZgpPfANQiXz1/S0ChQSrvV6lPmjftzQq5aHWgp92kgkiSpiJlqD7 ypJU6SH5uqyaVpdJSKB/8kW+WsKKCL4AfCEk+KeGJqtGQ3ggcDzMVYkerFZWGQbYp5nm Xy0DVOxG7D5JUzb3/b9Yc0kBmj6oDh81HzPO03uNUdDeoqPfTqksnWa9XgMTswZrMJWj ULXrFRBnkBfgTz9cG6Psl++LgZD7b0lU7wkP2YlhbUicxczxZ2gTlJmpwRhkuIHVMNDf 5fU5pD/skgVnIsYGzldlSnmxjx3VLSCrLcatKENZ0C7+jmkj/BYrPFvnPgSyH0zTXmXP CXqQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=I5+wJOxwhL7DUga1GO9JfHtWOY7JNRdc/QLwCJiHehs=; b=tojltHbPuHXZL6FtagZ/k1Y8fRxCKlxlkQHdI7GfrYmgt7JdrHRtT3+EhQ/1RHtV10 AocgHPqsEEH13KYP+6QGegmIjAcyZZcCQJ4yi4+gJQUlfIN/hdAH50BSVxV+AeOduEop qwUg74fismKTYlhn5ZTHPkbPiLEa5eA2ff/cbG8ZdvwOyY9eIICytjHODVMgKUu4lFrr JKrJ3jqPIvV7ZI/wePm5WJjt6u2ZtGORP6bNjvcGRn7QUcM4LyY3Q169bMS+XytiO9q7 wgj5aOjEAKSw5q1X+tCVs9RY6LVoOkRVe9Zbj6dyx06ISCuY9Yw8tKd7vbkkJEEbdK7F WVoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ku0Y7hpo; 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 w21si4379510plq.91.2019.07.03.22.41.34; Wed, 03 Jul 2019 22:41:49 -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=ku0Y7hpo; 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 S1727196AbfGDFlC (ORCPT + 99 others); Thu, 4 Jul 2019 01:41:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:47206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbfGDFlC (ORCPT ); Thu, 4 Jul 2019 01:41:02 -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 9560221882; Thu, 4 Jul 2019 05:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562218861; bh=e8TNcyelEwd3uBfOzE7u6HsVzn4zKxUqsTBHoLp6L4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ku0Y7hpoqBS6APNaFuh3irUgN47JKJr78lnWKhlsZ/VI6RkaVk4gAxP9dRYX+4n5k a80+L+oQbzZGypfwGACLFiIEHBXubXt5nBmKXobQHaZTmIOG4ioBNK4mXYKmYotUcF 1Z9Mes4ZtNuHFHgEFGePG5+XzLuNJH0Wd/Ba2onk= Date: Thu, 4 Jul 2019 07:40:58 +0200 From: Greg KH To: Benjamin Herrenschmidt Cc: Muchun Song , rafael@kernel.org, prsood@codeaurora.org, mojha@codeaurora.org, gkohli@codeaurora.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 OPT2] driver core: Fix use-after-free and double free on glue directory Message-ID: <20190704054058.GC347@kroah.com> References: <20190626144021.7249-1-smuchun@gmail.com> <20190703193606.GA8452@kroah.com> <319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <319ae04497cf1982076bf801cfdf565046096fd4.camel@kernel.crashing.org> 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 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? thanks, greg k-h