From patchwork Fri Jun 23 12:47:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 9806347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EE80260349 for ; Fri, 23 Jun 2017 12:50:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD5F228769 for ; Fri, 23 Jun 2017 12:50:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D074B2876F; Fri, 23 Jun 2017 12:50:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5108128769 for ; Fri, 23 Jun 2017 12:50:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dOO0M-0000R8-ED; Fri, 23 Jun 2017 12:48:06 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dOO0L-0000Ql-8d for xen-devel@lists.xenproject.org; Fri, 23 Jun 2017 12:48:05 +0000 Received: from [85.158.139.211] by server-16.bemta-5.messagelabs.com id B9/BE-01752-40E0D495; Fri, 23 Jun 2017 12:48:04 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrIIsWRWlGSWpSXmKPExsXilM8ircvM5xt p0HHK2uL7lslMDowehz9cYQlgjGLNzEvKr0hgzdiydwNLwSGOioUz3jE2MC5l72Lk4hASWMUo seTRTsYuRk4gJ1vi1by7bCAJFoGfLBKvruxmA0lICHhKNP3fzAhhO0t0d65mg+g+xChxsPsTE 0iCTSBUon37DFYQW0RASeLeqslMIEXMAjOZJK49eAZWJCzgJNH66CtYEYuAqsTfZ+eYuxg5OH gF/CWe3uSHWCAncfNcJzOIzSsgKHFy5hMWkBJmAXWJ9fOEQML8QOO3rb8Mdg+zgLxE89bZzBM YBWch6ZiF0DELSdUCRuZVjOrFqUVlqUW6JnpJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXrJ +bmbGIFBywAEOxhv9TkfYpTkYFIS5Y094xMpxJeUn1KZkVicEV9UmpNafIhRhoNDSYJ3BY9vp JBgUWp6akVaZg4wfmDSEhw8SiK82zmA0rzFBYm5xZnpEKlTjIpS4rztIH0CIImM0jy4NljMXm KUlRLmZQQ6RIinILUoN7MEVf4VozgHo5Iw7x6QKTyZeSVw018BLWYCWjxjjQ/I4pJEhJRUAyO j4tplzG8t0zZeFr/m2V52aVrOwwKbXV4bt00t1g9U+zvT4ozpXavDcQwyN0PbtxumcSjPX3rX WiPGnXHSptRfCTyzOIUn5GgL65j3snwUeDvVKtdY1LO5ItBt2laf64KMM17PXGv49YBV+OENe svV+8wXvZlwNHxLukXr3HkeGtMvylc1bVFiKc5INNRiLipOBAA3ZzxD1AIAAA== X-Env-Sender: marmarek@invisiblethingslab.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1498222083!104587928!1 X-Originating-IP: [66.111.4.27] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTExLjQuMjcgPT4gODQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 22948 invoked from network); 23 Jun 2017 12:48:03 -0000 Received: from out3-smtp.messagingengine.com (HELO out3-smtp.messagingengine.com) (66.111.4.27) by server-6.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 23 Jun 2017 12:48:03 -0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id F3984206E6; Fri, 23 Jun 2017 08:48:02 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Fri, 23 Jun 2017 08:48:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=avT4HZu87dKnxm2by2 SsbTt0Js6SWl4HM9Qx0JJjoL8=; b=nwMa9XTkyElWKskttyDb/mUiS49jCdegoX 64gxDC+sRmWqsDN6VSD+rw/eUwSHrOvtANVffNZgWhABPzO2X6tySzeem6Ytu0uT Gelshm9BeiV56rDLPVogrk99vbJhqs6+qoYgYOPxzQ1hC2dfYEui/lz1FiHOpyYv t/oQQBs8N7PYfHj3Xu8EClnSBcg0YzGysgaVSAJQPGFeE5OeYWcCMLyONV/w5t08 LeQaIQ83nLEc5e3/o4jQGoILN1zGmT2CpYuoa8+4ia45Uo5Yw3CtkCJR5NFDI4Na 7XgF4EERHtHWnvo/KyUU1V4FGxgEHsVg0h7zQUnaAesEjYanSMdQ== X-ME-Sender: X-Sasl-enc: 72JgBp9p5TXYBeVZpw7Cij/UdnK5zyC0whBmHYXHXaA8 1498222081 Received: from devel-3rdparty.localdomain (89-70-103-23.dynamic.chello.pl [89.70.103.23]) by mail.messagingengine.com (Postfix) with ESMTPA id 5B70524767; Fri, 23 Jun 2017 08:47:59 -0400 (EDT) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org 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 Organization: Invisible Things Lab Cc: Juergen Gross , Andrew Cooper , x86@kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Boris Ostrovsky Subject: [Xen-devel] [PATCH] x86/xen: allow userspace access during hypercalls X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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; }