On Fri, Jan 26, 2018 at 03:29:10PM +0000, Roger Pau Monne wrote:
> Disable SMAP in the shim before bouncing the hypercall, or else L0
> will fail to get the hypercall buffer.
> 
> Signed-off-by: Roger Pau Monné <roger....@citrix.com>
> Reported-by: Fatih Acar <fatih.a...@gandi.net>
> ---
> Cc: Jan Beulich <jbeul...@suse.com>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>
> Cc: Ian Jackson <ian.jack...@eu.citrix.com>
> Cc: Wei Liu <wei.l...@citrix.com>
> ---
> Needs to be backported to the 4.10.0-shim-comet branch.
> ---
>  xen/arch/x86/pv/shim.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
> index d5383dcfc7..eb1ee7d3c4 100644
> --- a/xen/arch/x86/pv/shim.c
> +++ b/xen/arch/x86/pv/shim.c
> @@ -748,7 +748,10 @@ static long pv_shim_grant_table_op(unsigned int cmd,
>      }
>  
>      case GNTTABOP_query_size:
> +        /* Disable SMAP so L0 can access the buffer. */

Interesting.

> +        stac();
>          rc = xen_hypercall_grant_table_op(GNTTABOP_query_size, uop.p, count);
> +        clac();

There is so far only one instance of this, so doing this ad-hoc stac /
clac is OK.

Probably another (more uniformed) way of fixing it is to have our own
buffer (forbid passing through uop directly) and the copy back the
result. Or we should invent a set of macros to deal with uop.

Either way, we'd better establish a rule going forward.

Wei.

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

Reply via email to