Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1731155

Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version

From Andrew Cooper <andrew.cooper3@citrix.com>
Newsgroups linux.kernel
Subject Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version
Date 2017-09-12 21:00 +0200
Message-ID <uoYzG-4ZA-45@gated-at.bofh.it> (permalink)
References <unu0V-Sv-3@gated-at.bofh.it> <unu0W-Sv-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/09/17 15:48, Juergen Gross wrote:
>  static void gnttab_request_version(void)
>  {
> -	int rc;
> +	long rc;
>  	struct gnttab_set_version gsv;
>  
> -	gsv.version = 1;
> +	rc = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);

This hypercall is information leak and layering violation.  Please can
we avoid adding more dependence on its presence?  (I'm got a
proto-series which strips various corners off the hypervisor for attack
surface reduction purposes, and this hypercall is one victim which is
restricted to privileged domains only.)

For translated guests, it is definitely not the right number to check. 
What matters is the maximum frame inside the translated guest, not on
the host.

For PV guests, I'm not sure what to suggest, but the result of
XENMEM_maximum_ram_page isn't applicable.  Xen's max_page can increase
at runtime through memory hotplug, after which ballooning operations can
leave Linux with a frame it wishes to grant which exceeds the limit
calculated here.

The more I look into this, the more of a mess it turns out to be.

~Andrew

> +	if (rc < 0 || !(rc >> 32))
> +		gsv.version = 1;
> +	else
> +		gsv.version = 2;
> +	if (xen_gnttab_version >= 1 && xen_gnttab_version <= 2)
> +		gsv.version = xen_gnttab_version;
>  
>  	rc = HYPERVISOR_grant_table_op(GNTTABOP_set_version, &gsv, 1);
>  	if (rc == 0 && gsv.version == 2)

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version Andrew Cooper <andrew.cooper3@citrix.com> - 2017-09-12 21:00 +0200
  Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version Juergen Gross <jgross@suse.com> - 2017-09-13 11:30 +0200
    Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version Juergen Gross <jgross@suse.com> - 2017-09-15 15:10 +0200
      Re: [Xen-devel] [PATCH 4/4] xen: select grant interface version Juergen Gross <jgross@suse.com> - 2017-09-15 15:30 +0200
      Re: [Xen-devel] [PATCH 4/4] xen: select grant interface  version "Jan Beulich" <JBeulich@suse.com> - 2017-09-15 15:30 +0200

csiph-web