Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6918494yba; Thu, 2 May 2019 00:20:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzTVE652OnHX4n1sZ4TmHQjy2DvoSU/Nf8ZzYTKA+cFXrw84asPo7Rh7Vw69ftHEoh1/aQh X-Received: by 2002:a63:5b58:: with SMTP id l24mr2335474pgm.139.1556781655199; Thu, 02 May 2019 00:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556781655; cv=none; d=google.com; s=arc-20160816; b=CM0Y7nQB3d1wqg6ouJ1lT0y+W9iBMciYsypt9nbdGjeKgezh/k0YP3lAwQJTkVXvCT jl8IyqUycxoWJFn+jddC6tsqr8+MV01hXv7SkgdLuyoMNc9LY4tvThg12IYvkJhcuD3T WohMotaql1+MJwThFFS4tmoU+RjtdOoxuXINHaEI/tHAsxdAVDO+7zs/jUHOPEnCjrhy 5sR+DELIZtaazMiSF0IaFaaCMfnlSaDFbA/4Z3bSYVI1rWRG7H/GzckuHxB2WpTUv+Gp nVBZ/zU+3Y1c9KzLy4xMKOdjwiN3zWQipHVUp2aZTIW9k45kzYLM2Og9sIBYlECKbZ9A /0VA== 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=qyYnVY457R47xA7ZDYMckPqlJVtrhuIeXgqQI+46iLY=; b=aRFBDUd8vXfEZFjjqrrb8ifjiErIhEV/R6zNHKj4veVBEIaRMcn65X+4oTSTDXNr4C 65IxgOUbJR3uGzCJSAtQ4HCQ9bu/9vObvCPWqRgA0Ly66pimzL0Bwqiun559tzzCNw34 p7H7LYb/IB/H8IWLMOPzU4MxyUk3r7YRvLb6jSPczV9NaM2xugCkkXWgOYmg8hFO21TG pLlatRWD+uMfzK28sUuT8WV2f2L40WRz4gsx0eCCZKObAiiuwyWWbPCCVeOXmkFUiQT7 rmhSkUmjwED0gZdu/6629HqwATSRdvBe+9/r23RNX6EyHusKDSpcW+v/4RrU1pdqckdl 9lKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NDNXVSmG; 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 11si698875pfu.224.2019.05.02.00.20.32; Thu, 02 May 2019 00:20:55 -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=NDNXVSmG; 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 S1726242AbfEBHTd (ORCPT + 99 others); Thu, 2 May 2019 03:19:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:44514 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726055AbfEBHTc (ORCPT ); Thu, 2 May 2019 03:19:32 -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 5EE5A2085A; Thu, 2 May 2019 07:19:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556781571; bh=BkSh3FIMwtQhnHhI9uVzzrmkVqCsaczpGUTBFako1F0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NDNXVSmG9ZZmNQhafwrMk+Wouh+FE5BDIAFxhOWExL/pCWm6dq9krH1gbEiSXb7A1 1bL9WQ4VZSFJhHxZlZdSgaywgcspow1qvXMwjI4uOhusMBmPMtiy3J8N3tPU85NFtJ XRRBQp/bdA2OR1Vd8SMYFox0hvPDI4RD6VBRNc3I= Date: Thu, 2 May 2019 09:19:29 +0200 From: Greg Kroah-Hartman To: "Tobin C. Harding" Cc: "Rafael J. Wysocki" , Tyrel Datwyler , Andy Shevchenko , Petr Mladek , Miroslav Benes , Viresh Kumar , Linux Kernel Mailing List Subject: Re: kobject_init_and_add() confusion Message-ID: <20190502071929.GD16247@kroah.com> References: <20190430233803.GB10777@eros.localdomain> <20190501111022.GA15959@kroah.com> <20190501215858.GE18827@eros.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190501215858.GE18827@eros.localdomain> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 02, 2019 at 07:58:58AM +1000, Tobin C. Harding wrote: > On Wed, May 01, 2019 at 01:10:22PM +0200, Greg Kroah-Hartman wrote: > > On Wed, May 01, 2019 at 09:38:03AM +1000, Tobin C. Harding wrote: > > > Hi, > > > > > > Looks like I've created a bit of confusion trying to fix memleaks in > > > calls to kobject_init_and_add(). Its spread over various patches and > > > mailing lists so I'm starting a new thread and CC'ing anyone that > > > commented on one of those patches. > > > > > > If there is a better way to go about this discussion please do tell me. > > > > > > The problem > > > ----------- > > > > > > Calls to kobject_init_and_add() are leaking memory throughout the kernel > > > because of how the error paths are handled. > > > > s/are leaking/have the potential to leak/ > > > > Note, no one ever hits these error paths, so it isn't a big issue, and > > is why no one has seen this except for the use of syzbot at times. > > One day I'll find an important issue to fix in the kernel. At the > moment sweeping these up is good practice/learning. If you have any > _real_ issues that need someone to turn the crank on feel free to dump > them on me :) Once you get this done, I do have some "fun" ideas about the cdev api and how it can be "fixed up". Your knowledge of reference counts and kobjects will come in handy there, so talk to me off-list when you are ready :) keep up the great work, greg k-h