All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Frediano Ziglio <freddy77@gmail.com>,
	Ian Campbell <ian.campbell@citrix.com>, Tim Deegan <tim@xen.org>,
	Stefano Stabellini <stefano.stabellini@citrix.com>
Cc: xen-devel@lists.xen.org
Subject: Re: [RFC PATCH] xen/arm: try to get stack in any case
Date: Fri, 17 Oct 2014 16:46:44 +0100	[thread overview]
Message-ID: <544139E4.9040409@linaro.org> (raw)
In-Reply-To: <CAHt6W4e0bvuwRWpCQ45ZUMpQya0vGYZBuMkQQXoS=MF=d9xY6A@mail.gmail.com>

Hi Frediano,

On 10/17/2014 04:22 PM, Frediano Ziglio wrote:
> Well,
>   this is more an experiment than a patch but in my case was really
> useful. Basically I was trying to get dom0 raw stack hitting '0' key
> on Xen console. The problem is that when you hit such key you are Xen
> domain, not domain 0 (code is called from Xen console). While Xen is
> handling '0' command (dump dom0 state) show_guest_stack (in
> xen/arch/arm/traps.c) try to get page from stack pointer failing as is
> not current domain. In my case I had only domain0 so EL1 TTBR0/TTBR1
> was domain0 and this patch work but obviously this can lead on real
> cases to dump pages not from the wanted domain.

I guess you see "Failed to convert stack to physical address"?

> Possible solution is to get manually TTBR0/TTBR1 from the proper
> domain and manually parse page tables. Now some question
> - did somebody else have same issue?
> - is there any helper function to get the proper page?

The function get_page is used in many different place to get a reference
to the page and check if the page belongs to the domain.

This patch would lead to a security issue on most of the hypercalls that
deal with memory.

The proper solution would be to switch temporally on the p2m of the v we
want to dump (see an example with flush_tlb_domain());

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-10-17 15:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 15:22 [RFC PATCH] xen/arm: try to get stack in any case Frediano Ziglio
2014-10-17 15:46 ` Julien Grall [this message]
2014-10-20  8:30   ` Ian Campbell
2014-10-20  8:34     ` Frediano Ziglio

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=544139E4.9040409@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=freddy77@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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.