From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bart Van Assche <bvanassche@acm.org>,
Jeff Mahoney <jeffm@suse.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
device-mapper development <dm-devel@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Paul McKenney <paulmck@linux.vnet.ibm.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: kobject: provide kobject_put_wait to fix module unload race
Date: Tue, 7 Jan 2014 17:32:20 -0500 [thread overview]
Message-ID: <20140107223220.GA20588@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1401071506420.26598@file01.intranet.prod.int.rdu2.redhat.com>
On Tue, Jan 07 2014 at 3:16pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> On Tue, 7 Jan 2014, Mike Snitzer wrote:
>
> > I've staged your patch in linux-next for 3.14, see:
> > http://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=af7b1e5c767fc895788c971c8f4686402ac8344f
>
> Looking at this patch, I realize that it is buggy too. If module unload
> happens at this point (after the completion is signaled, but before the
> release function returns), it crashes.
>
> static void dm_kobject_release(struct kobject *kobj)
> {
> complete(dm_get_completion_from_kobject(kobj));
> >========== module unload here ===============<
> }
That race isn't a surprise, thought you pointed it out earlier in this
thread? Anyway, I'm inclined to keep the racey patch staged in
linux-dm.git until the stalemate with gregkh is resolved. DM is no
worse than other code that follows this same wait for completion
pattern.
> The patch that I sent initially in this thread doesn't have this bug
> because the completion is signaled in non-module code.
>
> That goes back to my initial claim - it is impossible to use the kobject
> interface correctly! But if Greg doesn't want a patch that fixes the
> kobject interface, I don't really know what to do about it.
Right, I'm missing what is wrong with your proposed kobject_put_wait
interface.
Greg, can you please establish that you understand the problem, and
existing kobject patterns, before you dismiss a fix?
WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Bart Van Assche <bvanassche@acm.org>,
Jeff Mahoney <jeffm@suse.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
device-mapper development <dm-devel@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Paul McKenney <paulmck@linux.vnet.ibm.com>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: kobject: provide kobject_put_wait to fix module unload race
Date: Tue, 7 Jan 2014 17:32:20 -0500 [thread overview]
Message-ID: <20140107223220.GA20588@redhat.com> (raw)
In-Reply-To: <alpine.LRH.2.02.1401071506420.26598@file01.intranet.prod.int.rdu2.redhat.com>
On Tue, Jan 07 2014 at 3:16pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:
> On Tue, 7 Jan 2014, Mike Snitzer wrote:
>
> > I've staged your patch in linux-next for 3.14, see:
> > http://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=af7b1e5c767fc895788c971c8f4686402ac8344f
>
> Looking at this patch, I realize that it is buggy too. If module unload
> happens at this point (after the completion is signaled, but before the
> release function returns), it crashes.
>
> static void dm_kobject_release(struct kobject *kobj)
> {
> complete(dm_get_completion_from_kobject(kobj));
> >========== module unload here ===============<
> }
That race isn't a surprise, thought you pointed it out earlier in this
thread? Anyway, I'm inclined to keep the racey patch staged in
linux-dm.git until the stalemate with gregkh is resolved. DM is no
worse than other code that follows this same wait for completion
pattern.
> The patch that I sent initially in this thread doesn't have this bug
> because the completion is signaled in non-module code.
>
> That goes back to my initial claim - it is impossible to use the kobject
> interface correctly! But if Greg doesn't want a patch that fixes the
> kobject interface, I don't really know what to do about it.
Right, I'm missing what is wrong with your proposed kobject_put_wait
interface.
Greg, can you please establish that you understand the problem, and
existing kobject patterns, before you dismiss a fix?
next prev parent reply other threads:[~2014-01-07 22:32 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-04 18:06 [PATCH] kobject: provide kobject_put_wait to fix module unload race Mikulas Patocka
2014-01-04 18:14 ` Jeff Mahoney
2014-01-05 3:48 ` Greg Kroah-Hartman
2014-01-04 18:16 ` Greg Kroah-Hartman
2014-01-04 18:34 ` Al Viro
2014-01-04 22:42 ` Dmitry Torokhov
2014-01-05 22:11 ` Mikulas Patocka
2014-01-05 22:39 ` Dmitry Torokhov
2014-01-06 18:43 ` Mikulas Patocka
2014-01-04 20:35 ` Mikulas Patocka
2014-01-05 3:42 ` Greg Kroah-Hartman
2014-01-05 6:05 ` Dmitry Torokhov
2014-01-05 18:27 ` Greg Kroah-Hartman
2014-01-05 22:04 ` Mikulas Patocka
2014-01-05 22:23 ` Greg Kroah-Hartman
2014-01-05 16:43 ` [dm-devel] " Bart Van Assche
2014-01-05 18:26 ` Greg Kroah-Hartman
2014-01-06 18:55 ` Mikulas Patocka
2014-01-06 19:23 ` Greg Kroah-Hartman
2014-01-06 21:31 ` Mike Snitzer
2014-01-07 4:01 ` Mikulas Patocka
2014-01-07 5:25 ` Linus Torvalds
2014-01-07 18:00 ` Mikulas Patocka
2014-01-07 19:19 ` Mike Snitzer
2014-01-07 20:16 ` Mikulas Patocka
2014-01-07 22:32 ` Mike Snitzer [this message]
2014-01-07 22:32 ` Mike Snitzer
2014-01-07 14:16 ` Greg Kroah-Hartman
2014-01-07 18:16 ` Mikulas Patocka
2014-01-07 18:26 ` Dmitry Torokhov
2014-01-05 22:04 ` [dm-devel] [PATCH] " Mikulas Patocka
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=20140107223220.GA20588@redhat.com \
--to=snitzer@redhat.com \
--cc=bvanassche@acm.org \
--cc=dm-devel@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=jeffm@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mpatocka@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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.