All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Greg KH <gregkh@linuxfoundation.org>,
	Li Zhong <zhong@linux.vnet.ibm.com>
Cc: linux-next list <linux-next@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	rmk+kernel@arm.linux.org.uk
Subject: Re: [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early
Date: Thu, 22 Aug 2013 16:30:53 +0930	[thread overview]
Message-ID: <87vc2yciqi.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20130821161819.GA14364@kroah.com>

Greg KH <gregkh@linuxfoundation.org> writes:
> On Wed, Aug 21, 2013 at 05:49:58PM +0800, Li Zhong wrote:
> >  struct kobj_type module_ktype = {
> > +	.release   =	module_kobj_release,
> >  	.sysfs_ops =	&module_sysfs_ops,
> >  };
>
> Wait, as there is no release function here for the kobject (a different
> problem), why is the deferred release function causing any problems?
> There is no release function to call, so what is causing the oops?

Because DEBUG_KOBJECT_RELEASE does the kobject_put() sometime later,
which is what causes the oops.

Since kobjects don't have an owner field, AFAICT someone *could* grab
one in a module which is unloading, then put it after unload.   So this
fixes a real bug, albeit not one seen in the real world.

Applied,
Rusty.

  parent reply	other threads:[~2013-08-22  7:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21  9:49 [RFC PATCH next]module: Fix mod->mkobj.kobj potentially freed too early Li Zhong
2013-08-21 16:18 ` Greg KH
2013-08-22  2:34   ` Li Zhong
2013-08-22  4:03     ` Greg KH
2013-08-22  5:37       ` Li Zhong
2013-08-22  7:37       ` [RFC PATCH v2 " Li Zhong
2013-08-22 21:58         ` Greg KH
2013-08-25  4:07         ` Greg KH
2013-08-27  4:38           ` Rusty Russell
2013-08-27  6:21             ` Greg KH
2013-09-01 23:51               ` Rusty Russell
2013-09-02  0:43                 ` Greg KH
2013-08-22  7:00   ` Rusty Russell [this message]
2013-08-22  7:50     ` [RFC PATCH " Li Zhong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vc2yciqi.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=zhong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.