diff options
author | Andy Lutomirski <luto@kernel.org> | 2016-05-24 15:48:38 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-06-11 11:28:11 +0200 |
commit | 99158f10e91768d34c5004c40c42f802b719bcae (patch) | |
tree | be7ebaf9fcbdf9be940531fa481f66a119d4ea18 /arch | |
parent | 50c0587eedc15235144216f2d2a5bd2a85e03289 (diff) | |
download | linux-99158f10e91768d34c5004c40c42f802b719bcae.tar.gz linux-99158f10e91768d34c5004c40c42f802b719bcae.tar.bz2 linux-99158f10e91768d34c5004c40c42f802b719bcae.zip |
x86/xen: Simplify set_aliased_prot()
A year ago, via the following commit:
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().
No change in functionality.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: David Vrabel <dvrabel@cantab.net>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: xen-devel <xen-devel@lists.xen.org>
Link: http://lkml.kernel.org/r/0706f1a2538e481194514197298cca6b5e3f2638.1464129798.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/enlighten.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 760789ae8562..0f87db2cc6a8 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, v, 1); if (HYPERVISOR_update_va_mapping((unsigned long)v, pte, 0)) BUG(); |