Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1406502

[PATCH 1/7] x86/xen: Simplify set_aliased_prot

From Andy Lutomirski <luto@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 1/7] x86/xen: Simplify set_aliased_prot
Date 2016-05-25 01:00 +0200
Message-ID <rCtsR-Yb-5@gated-at.bofh.it> (permalink)
References <rCtjb-Ur-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


In aa1acff356bb ("x86/xen: Probe target addresses in
set_aliased_prot() before the hypercall"), I added an explicit probe
to work around a hypercall issue.  The code can be simplified by
using probe_kernel_read.

Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <dvrabel@cantab.net>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 arch/x86/xen/enlighten.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 6ab672233ac9..eed696c229ba 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -521,9 +521,7 @@ static void set_aliased_prot(void *v, pgprot_t prot)
 
 	preempt_disable();
 
-	pagefault_disable();	/* Avoid warnings due to being atomic. */
-	__get_user(dummy, (unsigned char __user __force *)v);
-	pagefault_enable();
+	probe_kernel_read(&dummy, (unsigned char *)v, 1);
 
 	if (HYPERVISOR_update_va_mapping((unsigned long)v, pte, 0))
 		BUG();
-- 
2.5.5

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] x86: uaccess hardening, easy part Andy Lutomirski <luto@kernel.org> - 2016-05-25 00:50 +0200
  [PATCH 5/7] x86/uaccess: Warn on uaccess faults other than #PF Andy Lutomirski <luto@kernel.org> - 2016-05-25 00:50 +0200
    Re: [PATCH 5/7] x86/uaccess: Warn on uaccess faults other than #PF Borislav Petkov <bp@alien8.de> - 2016-05-25 11:50 +0200
      Re: [PATCH 5/7] x86/uaccess: Warn on uaccess faults other than #PF Andy Lutomirski <luto@amacapital.net> - 2016-05-29 18:50 +0200
  [PATCH 1/7] x86/xen: Simplify set_aliased_prot Andy Lutomirski <luto@kernel.org> - 2016-05-25 01:00 +0200
    Re: [PATCH 1/7] x86/xen: Simplify set_aliased_prot Andrew Cooper <andrew.cooper3@citrix.com> - 2016-05-25 11:40 +0200
    Re: [Xen-devel] [PATCH 1/7] x86/xen: Simplify set_aliased_prot David Vrabel <david.vrabel@citrix.com> - 2016-05-25 12:00 +0200
  [PATCH 3/7] x86/uaccess: Give uaccess faults their own handler Andy Lutomirski <luto@kernel.org> - 2016-05-25 01:00 +0200
  [PATCH 2/7] x86/extable: Pass error_code and an extra unsigned long to exhandlers Andy Lutomirski <luto@kernel.org> - 2016-05-25 01:00 +0200
  Re: [PATCH 0/7] x86: uaccess hardening, easy part Brian Gerst <brgerst@gmail.com> - 2016-05-25 06:00 +0200
    Re: [PATCH 0/7] x86: uaccess hardening, easy part Kees Cook <keescook@chromium.org> - 2016-05-25 19:20 +0200
  Re: [PATCH 0/7] x86: uaccess hardening, easy part Kees Cook <keescook@chromium.org> - 2016-05-25 19:40 +0200

csiph-web