Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497AbdFZMF6 (ORCPT ); Mon, 26 Jun 2017 08:05:58 -0400 Received: from mx2.suse.de ([195.135.220.15]:60615 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751391AbdFZMFv (ORCPT ); Mon, 26 Jun 2017 08:05:51 -0400 Subject: Re: [PATCH] x86/xen: allow userspace access during hypercalls To: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= , xen-devel@lists.xenproject.org Cc: Boris Ostrovsky , Andrew Cooper , x86@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <1498222072-18217-1-git-send-email-marmarek@invisiblethingslab.com> From: =?UTF-8?Q?Juergen_Gro=c3=9f?= Message-ID: <6f8113d8-10a2-b23f-16c1-8b97b2fba0bb@suse.com> Date: Mon, 26 Jun 2017 14:05:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <1498222072-18217-1-git-send-email-marmarek@invisiblethingslab.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1272 Lines: 44 On 06/23/2017 02:47 PM, Marek Marczykowski-Górecki wrote: > Userspace application can do a hypercall through /dev/xen/privcmd, and > some for some hypercalls argument is a pointers to user-provided > structure. When SMAP is supported and enabled, hypervisor can't access. > So, lets allow it. What about HYPERVISOR_dm_op? Juergen > > Cc: stable@vger.kernel.org > Signed-off-by: Marek Marczykowski-Górecki > --- > arch/x86/include/asm/xen/hypercall.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h > index f6d20f6..a1d2c5d 100644 > --- a/arch/x86/include/asm/xen/hypercall.h > +++ b/arch/x86/include/asm/xen/hypercall.h > @@ -43,6 +43,7 @@ > > #include > #include > +#include > > #include > #include > @@ -214,10 +215,12 @@ privcmd_call(unsigned call, > __HYPERCALL_DECLS; > __HYPERCALL_5ARG(a1, a2, a3, a4, a5); > > + stac(); > asm volatile("call *%[call]" > : __HYPERCALL_5PARAM > : [call] "a" (&hypercall_page[call]) > : __HYPERCALL_CLOBBER5); > + clac(); > > return (long)__res; > } >