From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>, David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: Revokable Grants Design (draft B)
Date: Thu, 28 Jan 2016 16:53:57 +0000 [thread overview]
Message-ID: <56AA47A5.2020405@citrix.com> (raw)
In-Reply-To: <56AA43E902000078000CC1B4@prv-mh.provo.novell.com>
On 28/01/16 15:38, Jan Beulich wrote:
>>>> On 25.01.16 at 18:20, <david.vrabel@citrix.com> wrote:
>> High Level Design
>> =================
>>
>> A revokable grant is indicated by an additional flag in the grant
>> table entry. A domain may only map such a grant using a new sub-op
>> (`GNTABOP_map_revokable`) and must supply a local GFN.
>>
>> When the granting domain wishes to revoke a grant it:
>>
>> 1. Removes access from the grant, but does not make the grant
>> available for other uses. The prevents any new grant map or copies
>> from starting.
>>
>> 2. Makes a `GNTTABOP_revoke` hypercall if the grant is in use (e.g.,
>> mapped). The hypervisor atomically switches any mappings of the
>> grant to the local GFN supplied when it was mapped. The hypervisor
>> will also wait for any in-progress grant copies to complete.
>
> What about transfers? Presumably no-one uses them these days,
> but they're part of the interface and hence need to be considered.
> (But I guess accounting for them here is as simple as naming them
> alongside copies. Or wait, "Low Level Design" seems to suggest you
> simply disallow transfers for them.)
Transfers would be disallowed. Or rather, only map_revokable and copy
are allowed.
>> Low Level Design
>> ================
>>
>> Grant Table Entry
>> -----------------
>>
>> A new `GTF_revokable` flag is added. A grant reference with this bit
>> set may only be mapped with `GNTTABOP_map_revokable` or copied with
>> `GNTTABOP_grant_copy` (subject to the usual permission checks).
>>
>> Attempts to use `GNTTABOP_map_grant_ref` with such a reference must
>> fail with -EACCESS. Without a replacement page, revoking such a
>> mapping would require clearing the mapping which would allow the
>> granter to trigger faults in the mapper.
>
> What about the inverse (GNTTABOP_map_revokable on non-
> revokable grant)? Failure, or some kind of indication to the caller that
> the GFN is not going to be used?
I would disallow it I think. I can't think of a case where this would
be useful.
>> ### `GNTTABOP_revoke`
>>
>> struct gnttab_revoke {
>> grant_ref_t ref;
>> };
>>
>> --------------------------------------------------------------------
>> Field Purpose
>> ----- ------------------------------------------------------
>> `ref` The grant reference whose access is being revoked.
>> --------------------------------------------------------------------
>>
>> The caller must first remove access from the grant reference to
>> prevent any new grant maps or copies from starting.
>
> Is the hypervisor expected to check this, and fail if it's not the
> case?
No. Because Xen cannot guard against the guest permitting access (e.g.,
by setting GTF_permit_access again or via another grant reference) while
the revoke hypercall is in progress.
Or possibly:
Yes, Because, although this won't catch all incorrect behaviour of the
guest, it will catch the most obvious mistake.
I can't decide on which is best.
David
next prev parent reply other threads:[~2016-01-28 16:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 17:20 Revokable Grants Design (draft B) David Vrabel
2016-01-28 15:38 ` Jan Beulich
2016-01-28 16:53 ` David Vrabel [this message]
2016-01-28 17:06 ` Jan Beulich
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=56AA47A5.2020405@citrix.com \
--to=david.vrabel@citrix.com \
--cc=JBeulich@suse.com \
--cc=dgdegra@tycho.nsa.gov \
--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.