From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Feng Wu <feng.wu@intel.com>
Cc: kevin.tian@intel.com, ian.campbell@citrix.com,
eddie.dong@intel.com, xen-devel@lists.xen.org, JBeulich@suse.com,
jun.nakajima@intel.com
Subject: Re: [PATCH v2 3/7] x86: Temporary disable SMAP to legally access user pages in kernel mode
Date: Wed, 23 Apr 2014 11:34:38 +0100 [thread overview]
Message-ID: <5357973E.5060205@citrix.com> (raw)
In-Reply-To: <1398263756-32093-1-git-send-email-feng.wu@intel.com>
On 23/04/14 15:35, Feng Wu wrote:
> Use STAC/CLAC to temporarily disable SMAP to allow legal accesses to
> user pages in kernel mode
>
> Signed-off-by: Feng Wu <feng.wu@intel.com>
> ---
> xen/arch/x86/domain_build.c | 3 +++
> xen/arch/x86/usercopy.c | 6 ++++++
> xen/arch/x86/x86_64/compat/entry.S | 2 ++
> xen/arch/x86/x86_64/entry.S | 4 ++++
> xen/include/asm-x86/uaccess.h | 4 ++++
> xen/include/asm-x86/x86_64/system.h | 2 ++
> 6 files changed, 21 insertions(+)
>
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index 84ce392..15af110 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -778,6 +778,7 @@ int __init construct_dom0(
> }
> bootstrap_map(NULL);
>
> + stac();
As constructing dom0 is trusted, this should be near the top of top of
the function
> if ( UNSET_ADDR != parms.virt_hypercall )
> {
> if ( (parms.virt_hypercall < v_start) ||
> @@ -787,6 +788,7 @@ int __init construct_dom0(
> write_ptbase(current);
> printk("Invalid HYPERCALL_PAGE field in ELF notes.\n");
> rc = -1;
> + clac();
and this should be after the out label.
> goto out;
> }
> hypercall_page_initialise(
> @@ -1150,6 +1152,7 @@ int __init construct_dom0(
> elf_check_broken(&elf));
>
> iommu_dom0_init(dom0);
> + clac();
This will need rebasing given recent changes in staging.
~Andrew
next prev parent reply other threads:[~2014-04-23 10:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 14:35 [PATCH v2 3/7] x86: Temporary disable SMAP to legally access user pages in kernel mode Feng Wu
2014-04-23 10:34 ` Andrew Cooper [this message]
2014-04-23 13:43 ` Wu, Feng
2014-04-23 14:12 ` Jan Beulich
2014-04-23 22:39 ` Wu, Feng
2014-04-23 10:39 ` Jan Beulich
2014-04-23 13:26 ` Wu, Feng
2014-04-23 14:09 ` Jan Beulich
2014-04-23 22:41 ` Wu, Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5357973E.5060205@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=eddie.dong@intel.com \
--cc=feng.wu@intel.com \
--cc=ian.campbell@citrix.com \
--cc=jun.nakajima@intel.com \
--cc=kevin.tian@intel.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.