From: Stefan Hajnoczi <stefanha@gmail.com>
To: Zhang Haoyu <zhanghy@sangfor.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] qemu-nbd: NULL nbd export pointer dereference after kill (TERMINATE)
Date: Mon, 11 Aug 2014 15:45:45 +0100 [thread overview]
Message-ID: <20140811144545.GE496@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <201408091133130940565@sangfor.com>
[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]
On Sat, Aug 09, 2014 at 11:33:14AM +0800, Zhang Haoyu wrote:
> After receive TERMINATE signal, qemu nbd state is set to TERMINATE, then in the main loop,
> nbd_export_close -> nbd_export_put is performed, but sometimes exp->refcount still greater than zero after nbd_export_put,
> so the qemu nbd state has not been set to TERMINATED, then in next cycle, NULL exp will be dereference.
> do {
> main_loop_wait(false);
> if (state == TERMINATE) {
> state = TERMINATING;
> nbd_export_close(exp);
> nbd_export_put(exp);
> exp = NULL;
> }
> } while (state != TERMINATED);
Please describe the scenario where refcount is greater than zero. The
commit description should describe the bug and how to reproduce it.
Do you have a test case that reproduces this crash?
Please look at QEMU's ./MAINTAINERS file and CC the appropriate people.
I have CCed Paolo Bonzini since he is the NBD maintainer. If you do not
CC the maintainers they may miss your patch.
Please
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-08-11 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-09 3:33 [Qemu-devel] [PATCH] qemu-nbd: NULL nbd export pointer dereference after kill (TERMINATE) Zhang Haoyu
2014-08-11 14:45 ` Stefan Hajnoczi [this message]
2014-08-17 8:13 ` Paolo Bonzini
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=20140811144545.GE496@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhanghy@sangfor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).