From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Cc: Juergen Gross <jgross@suse.com>,
Thomas Garnier <thgarnie@google.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: Mapping active GDT
Date: Mon, 13 Mar 2017 09:09:47 -0400 [thread overview]
Message-ID: <5c650498-526d-ccf7-f7a8-60946f06c7b1@oracle.com> (raw)
In-Reply-To: <45ca5d28-b627-b4d0-eced-002d6c7df379@citrix.com>
On 03/11/2017 08:06 AM, Andrew Cooper wrote:
> On 11/03/2017 03:58, Boris Ostrovsky wrote:
>> On 03/10/2017 09:39 PM, Boris Ostrovsky wrote:
>>> I am looking into GDT remap series [0] which crashes PV guests and it
>>> seems that the problem lies in the fact that we cannot establish new
>>> mapping to an already existing GDT.
>>>
>>> The mapping is created by
>>>
>>> +static inline void setup_fixmap_gdt(int cpu)
>>> +{
>>> + __set_fixmap(get_cpu_gdt_ro_index(cpu),
>>> + __pa(get_cpu_gdt_rw(cpu)), PAGE_KERNEL);
>>> +}
>>>
>>> with get_cpu_gdt_rw(cpu) being the current GDT pointer. This results in
>>>
>>> (XEN) mm.c:2570:d94v0 Bad type (saw 5400000000000001 != exp
>>> 7000000000000000) for mfn 1538fb (pfn 3e809)
>>> (XEN) mm.c:1022:d94v0 Could not get page type PGT_writable_page
>>> (XEN) mm.c:1074:d94v0 Error getting mfn 1538fb (pfn 3e809) from L1 entry
>>> 80000001538fb063 for l1e_owner=94, pg_owner=94
> The problem here is that you are trying to create a writeable mapping to
> the GDT frame.
>
> Allowing the guest writeable access would be a security hole, as it is
> trivial to escalate privilege under those circumstances.
Right, and I saw the same failure symptoms (hypervisor errors) even when
I replaced PAGE_KERNEL with PAGE_KERNEL_RO.
And then I realized that I was on a branch with other unrelated changes,
so I switched the branch and then things started to work. Thus my mea
culpa below.
-boris
>
> ~Andrew
>
>>> (after a small change to xen_set_fixmap(), which I think was missing)
>>>
>>> Before I try to come up with a fix I wanted to check here to see if this
>>> (not being able to map active GDT) is indeed the case.
>> Uhm.. Nevermind. The change in xen_set_fixmap() is probably sufficient.
>>
>> I was working with wrong branch ;-( Sorry for the noise.
>>
>> -boris
>>
>>> -boris
>>>
>>>
>>> [0]
>>> https://lists.xenproject.org/archives/html/xen-devel/2017-03/msg00869.html
>>>
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xen.org
>>> https://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-13 13:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-11 2:39 Mapping active GDT Boris Ostrovsky
2017-03-11 3:58 ` Boris Ostrovsky
2017-03-11 13:06 ` Andrew Cooper
2017-03-13 13:09 ` Boris Ostrovsky [this message]
2017-03-13 17:30 ` Thomas Garnier
2017-03-13 17:32 ` Boris Ostrovsky
2017-03-13 17:34 ` Thomas Garnier
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=5c650498-526d-ccf7-f7a8-60946f06c7b1@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=thgarnie@google.com \
--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 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).