All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH for-next 5/8] x86/domain: factor out pv_domain_destroy
Date: Mon, 10 Apr 2017 16:16:12 +0100	[thread overview]
Message-ID: <ddabdda5-219c-d422-41c2-4f2ad244d1b2@citrix.com> (raw)
In-Reply-To: <20170410151201.qm5aw2ezd54oprnp@citrix.com>

On 10/04/17 16:12, Wei Liu wrote:
> On Mon, Apr 10, 2017 at 04:04:22PM +0100, Andrew Cooper wrote:
>> On 10/04/17 14:27, Wei Liu wrote:
>>> No functional change.
>>>
>>> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
>> Throughout this series, please make sure you add in proper NULL'ing of
>> freed data.
>>
>> While this patch is no functional change at the moment, you have
>> introduced a latent double-free bug for if (/when) pv_domain_destroy()
>> gets used on a failed create path.
>>
> No it won't. I made pv_domain_initialise idempotent.

Ah - I hadn't spotted that.

My long-term goal is to reorder the init/destroy logic such that init
has no cleanup in it, and any failure comes out and calls destroy at the
top level.

This will avoid us opencoding the teardown logic twice;  we have had
bugs in the past where the two paths are different (the most common of
which is missing cleanup in the destroy path, leading to a memory leak).

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-04-10 15:16 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 13:27 [PATCH for-next 0/8] Refactor x86/domain.c Wei Liu
2017-04-10 13:27 ` [PATCH for-next 1/8] xen.h: fix comment for vcpu_guest_context Wei Liu
2017-04-24  9:51   ` Jan Beulich
2017-04-24 10:24     ` Julien Grall
2017-04-24 10:42     ` Wei Liu
2017-04-24 12:29       ` Jan Beulich
2017-04-24 12:55         ` Wei Liu
2017-04-10 13:27 ` [PATCH for-next 2/8] x86/domain: factor out pv_vcpu_initialise Wei Liu
2017-04-24  9:57   ` Jan Beulich
2017-04-24 11:16     ` Wei Liu
2017-04-10 13:27 ` [PATCH for-next 3/8] x86/domain: factor out pv_vcpu_destroy Wei Liu
2017-04-24  9:59   ` Jan Beulich
2017-04-10 13:27 ` [PATCH for-next 4/8] x86/domain: push some code down to hvm_domain_initialise Wei Liu
2017-04-10 15:19   ` Andrew Cooper
2017-04-25 12:15     ` Wei Liu
2017-04-24 10:10   ` Jan Beulich
2017-04-24 14:55     ` Wei Liu
2017-04-10 13:27 ` [PATCH for-next 5/8] x86/domain: factor out pv_domain_destroy Wei Liu
2017-04-10 15:04   ` Andrew Cooper
2017-04-10 15:12     ` Wei Liu
2017-04-10 15:16       ` Andrew Cooper [this message]
2017-04-10 15:22         ` Wei Liu
2017-04-10 15:27           ` Andrew Cooper
2017-04-24 10:11   ` Jan Beulich
2017-04-10 13:27 ` [PATCH for-next 6/8] x86/domain: factor out pv_domain_initialise Wei Liu
2017-04-24 10:20   ` Jan Beulich
2017-04-25 13:37     ` Wei Liu
2017-04-10 13:27 ` [PATCH for-next 7/8] x86/domain: move PV specific code to pv/domain.c Wei Liu
2017-04-24 12:39   ` Jan Beulich
2017-04-24 14:24     ` Wei Liu
2017-04-24 15:57       ` Jan Beulich
2017-04-10 13:27 ` [PATCH for-next 8/8] x86/domain: move HVM specific code to hvm/domain.c Wei Liu
2017-04-24 12:41   ` Jan Beulich
2017-04-24 13:12     ` Roger Pau Monné

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=ddabdda5-219c-d422-41c2-4f2ad244d1b2@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.