Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbdFWMsF (ORCPT ); Fri, 23 Jun 2017 08:48:05 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51337 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751231AbdFWMsD (ORCPT ); Fri, 23 Jun 2017 08:48:03 -0400 X-ME-Sender: X-Sasl-enc: 72JgBp9p5TXYBeVZpw7Cij/UdnK5zyC0whBmHYXHXaA8 1498222081 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: Boris Ostrovsky , Juergen Gross , Andrew Cooper , x86@kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , stable@vger.kernel.org Subject: [PATCH] x86/xen: allow userspace access during hypercalls Date: Fri, 23 Jun 2017 14:47:52 +0200 Message-Id: <1498222072-18217-1-git-send-email-marmarek@invisiblethingslab.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Organization: Invisible Things Lab Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1089 Lines: 38 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. 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; } -- 2.7.4