All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "josef@toxicpanda.com" <josef@toxicpanda.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>,
	"jbacik@fb.com" <jbacik@fb.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"alex@iss-integration.com" <alex@iss-integration.com>,
	"nbd@other.debian.org" <nbd@other.debian.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/3] nbd: del_gendisk after we cleanup the queue
Date: Fri, 13 Apr 2018 16:25:33 +0000	[thread overview]
Message-ID: <1f0ebe74a96c6515716a25b49ea588f9ee28e137.camel@wdc.com> (raw)
In-Reply-To: <20180413162132.xudowhvxyijbzqqa@destiny>

T24gRnJpLCAyMDE4LTA0LTEzIGF0IDEyOjIxIC0wNDAwLCBKb3NlZiBCYWNpayB3cm90ZToNCj4g
T24gRnJpLCBBcHIgMTMsIDIwMTggYXQgMDQ6MTY6MThQTSArMDAwMCwgQmFydCBWYW4gQXNzY2hl
IHdyb3RlOg0KPiA+IE9uIEZyaSwgMjAxOC0wNC0xMyBhdCAxMjowMyAtMDQwMCwgSm9zZWYgQmFj
aWsgd3JvdGU6DQo+ID4gPiBUaGlzIGZpeGVzIGEgdXNlIGFmdGVyIGZyZWUgYnVnLCB3ZSBuZWVk
IHRvIGRvIHRoZSBkZWxfZ2VuZGlzayBhZnRlciB3ZQ0KPiA+ID4gY2xlYW51cCB0aGUgcXVldWUg
b24gdGhlIGRldmljZS4NCj4gPiANCj4gPiBIZWxsbyBKb3NlZiwNCj4gPiANCj4gPiBXaGljaCB1
c2UtYWZ0ZXItZnJlZSBidWcgZG9lcyB0aGlzIHBhdGNoIGZpeD8gQXJlIHlvdSBhd2FyZSB0aGF0
IG1vc3QgYmxvY2sNCj4gPiBkcml2ZXJzIGNhbGwgYmxrX2NsZWFudXBfcXVldWUoKSBiZWZvcmUg
Y2FsbGluZyBkZWxfZ2VuZGlzaygpPyBXaHkgZG8geW91DQo+ID4gdGhpbmsgdGhhdCB0aGUgbmJk
IGRyaXZlciBzaG91bGQgdXNlIHRoZSBvcHBvc2l0ZSBvcmRlcj8NCj4gDQo+IEknbSBjb25mdXNl
ZCwgdGhhdCdzIHdoYXQgdGhpcyBwYXRjaCBkb2VzLiAgQmVmb3JlIEkgaGFkIGRlbF9nZW5kaXNr
KCkgZmlyc3QgYW5kDQo+IHRoZW4gdGhlIGJsa19jbGVhbnVwX3F1ZXVlKCksIHdoaWNoIHdhcyBi
dWdnaW5nIG91dCB3aGVuIEkgd2FzIHRlc3Rpbmcgc3R1ZmYNCj4gd2l0aCBhIG51bGwgcG9pbnRl
ciBkZXJlZiB3aGVuZXZlciBJIHJtbW9kJ2VkIHRoZSBuYmQuICBTd2FwcGluZyBpdCB0byB0aGUg
d2F5DQo+IGV2ZXJ5Ym9keSBlbHNlIGRpZCBpdCBmaXhlZCB0aGUgcHJvYmxlbS4gIFRoYW5rcywN
Cg0KSGVsbG8gSm9zZWYsDQoNCk9vcHMsIEkgc3dhcHBlZCAiYmxrX2NsZWFudXBfcXVldWUoKSIg
YW5kICJkZWxfZ2VuZGlzaygpIiBpbiBteSBlLW1haWwuDQoNCkNhbiB5b3Ugc2hhcmUgdGhlIGNh
bGwgc3RhY2sgb2YgdGhlIE5VTEwgcG9pbnRlciBkZXJlZiBhbmQgYWxzbyB0aGUgdHJhbnNsYXRp
b24NCm9mIHRoZSBjcmFzaCBhZGRyZXNzIGludG8gYSBzb3VyY2UgY29kZSBsaW5lPw0KDQpUaGFu
a3MsDQoNCkJhcnQuDQoNCg0K

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "josef@toxicpanda.com" <josef@toxicpanda.com>
Cc: "kernel-team@fb.com" <kernel-team@fb.com>,
	"jbacik@fb.com" <jbacik@fb.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"alex@iss-integration.com" <alex@iss-integration.com>,
	"nbd@other.debian.org" <nbd@other.debian.org>,
	"axboe@kernel.dk" <axboe@kernel.dk>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/3] nbd: del_gendisk after we cleanup the queue
Date: Fri, 13 Apr 2018 16:25:33 +0000	[thread overview]
Message-ID: <1f0ebe74a96c6515716a25b49ea588f9ee28e137.camel@wdc.com> (raw)
In-Reply-To: <20180413162132.xudowhvxyijbzqqa@destiny>

On Fri, 2018-04-13 at 12:21 -0400, Josef Bacik wrote:
> On Fri, Apr 13, 2018 at 04:16:18PM +0000, Bart Van Assche wrote:
> > On Fri, 2018-04-13 at 12:03 -0400, Josef Bacik wrote:
> > > This fixes a use after free bug, we need to do the del_gendisk after we
> > > cleanup the queue on the device.
> > 
> > Hello Josef,
> > 
> > Which use-after-free bug does this patch fix? Are you aware that most block
> > drivers call blk_cleanup_queue() before calling del_gendisk()? Why do you
> > think that the nbd driver should use the opposite order?
> 
> I'm confused, that's what this patch does.  Before I had del_gendisk() first and
> then the blk_cleanup_queue(), which was bugging out when I was testing stuff
> with a null pointer deref whenever I rmmod'ed the nbd.  Swapping it to the way
> everybody else did it fixed the problem.  Thanks,

Hello Josef,

Oops, I swapped "blk_cleanup_queue()" and "del_gendisk()" in my e-mail.

Can you share the call stack of the NULL pointer deref and also the translation
of the crash address into a source code line?

Thanks,

Bart.



  reply	other threads:[~2018-04-13 16:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-13 16:03 [PATCH 1/3] nbd: del_gendisk after we cleanup the queue Josef Bacik
2018-04-13 16:03 ` [PATCH 2/3] nbd: update size when connected Josef Bacik
2018-04-14  3:02   ` Alex Gorbachev
2018-04-13 16:03 ` [PATCH 3/3] nbd: use bd_set_size when updating disk size Josef Bacik
2018-04-14  3:01   ` Alex Gorbachev
2018-04-13 16:16 ` [PATCH 1/3] nbd: del_gendisk after we cleanup the queue Bart Van Assche
2018-04-13 16:16   ` Bart Van Assche
2018-04-13 16:21   ` Josef Bacik
2018-04-13 16:25     ` Bart Van Assche [this message]
2018-04-13 16:25       ` Bart Van Assche
2018-04-14  3:03 ` Alex Gorbachev

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=1f0ebe74a96c6515716a25b49ea588f9ee28e137.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=alex@iss-integration.com \
    --cc=axboe@kernel.dk \
    --cc=jbacik@fb.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-block@vger.kernel.org \
    --cc=nbd@other.debian.org \
    --cc=stable@vger.kernel.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.