lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080208235756.GA7876@kroah.com>
Date:	Fri, 8 Feb 2008 15:57:56 -0800
From:	Greg KH <greg@...ah.com>
To:	Badari Pulavarty <pbadari@...ibm.com>
Cc:	haveblue@...ibm.com, Andrew Morton <akpm@...ux-foundation.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [-mm PATCH] sysdev_unregister() should call kobject_del()

On Fri, Feb 08, 2008 at 03:22:29PM -0800, Badari Pulavarty wrote:
> 
> On Thu, 2008-02-07 at 20:55 -0800, Greg KH wrote:
> > On Thu, Feb 07, 2008 at 05:25:46PM -0800, Badari Pulavarty wrote:
> > > On Thu, 2008-02-07 at 16:38 -0800, Greg KH wrote:
> > > > On Thu, Feb 07, 2008 at 03:56:58PM -0800, Badari Pulavarty wrote:
> > > > > Hi Greg,
> > > > > 
> > > > > While playing with hotplug memory remove on 2.6.24-mm1, I 
> > > > > noticed that /sysfs directory entries are not getting removed.
> > > > > 
> > > > > sysdev_unregister() used to call kobject_unregister().
> > > > > But in 2.6.24-mm1, its only dropping the ref. It should
> > > > > call kobject_del() to remove the object. Correct ?
> > > > > 
> > > > > With this change, the directories are getting removed
> > > > > correctly. Comments ?
> > > > 
> > > > Ick, no, this shouldn't be needed, someone else must be holding a
> > > > reference to the kobject device somewhere.  See the kobject documenation
> > > > for more info.
> > > > 
> > > > I'll try to see where we grab 2 references...
> > > 
> > > I will take a closer look then. I was taking easy way out :(
> > 
> > Hm, I don't see anything obvious in the sys.c core.  What code is
> > controlling these objects that you are creating and removing from the
> > system?
> > 
> 
> I found the culprit. Its not in sys.c core :)

Glad to hear it :)

> remove_memory_block() takes a reference on kobject by calling
> find_memory_block(). It then calls  unregister_memory() to free up sysfs
> entry.
> It drops only one ref (which it got at register time). So it never gets
> freed up. I am going to send out a separate patch for it.

Ah, nice catch.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ