xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Paul Durrant <paul.durrant@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wl@xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH] viridian: make viridian_time_domain_freeze() safe to call...
Date: Wed, 21 Aug 2019 10:52:10 +0200	[thread overview]
Message-ID: <20190821085210.kjx53rseieu2uc5k@Air-de-Roger> (raw)
In-Reply-To: <20190821082258.36549-1-paul.durrant@citrix.com>

On Wed, Aug 21, 2019 at 09:22:58AM +0100, Paul Durrant wrote:
> ...on a partially destroyed domain.
> 
> viridian_time_domain_freeze() and viridian_time_vcpu_freeze() rely
> (respectively) on the dynamically allocated per-domain and per-vcpu viridian
> areas [1], which are freed during domain_relinquish_resources().
> Because arch_domain_pause() can call viridian_domain_time_freeze() this
> can lead to host crashes if e.g. a XEN_DOMCTL_pausedomain is issued after
> domain_relinquish_resources() has run.
> 
> To prevent such crashes, this patch adds a check of is_dying into
> viridian_time_domain_freeze(), and viridian_time_domain_thaw() which is
> similarly vulnerable to indirection into freed memory.
> 
> NOTE: The patch also makes viridian_time_vcpu_freeze/thaw() static, since
>       they have no callers outside of the same source module.
> 
> [1] See commit e7a9b5e72f26 "viridian: separately allocate domain and vcpu
>     structures".
> 
> Signed-off-by: Paul Durrant <paul.durrant@citrix.com>

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Note you could also drop the viridian_ prefix to the now static
functions.

Thanks, Roger.

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

  reply	other threads:[~2019-08-21  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21  8:22 [Xen-devel] [PATCH] viridian: make viridian_time_domain_freeze() safe to call Paul Durrant
2019-08-21  8:52 ` Roger Pau Monné [this message]
2019-08-21  9:13   ` Paul Durrant
2019-08-21 10:17     ` Andrew Cooper

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=20190821085210.kjx53rseieu2uc5k@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=paul.durrant@citrix.com \
    --cc=wl@xen.org \
    --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 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).