aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-07-31 16:58:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-11 21:35:20 -0400
commit75bc4446e0d553aceeb632ae05878786d6760e47 (patch)
treeb4ddcbc70fcadad7ccca9bca9f994b1619e9b0c0 /arch/arm/kernel
parenta5510daad56d3b9738d475957750db9d4fc607a9 (diff)
ARM: make vectors page inaccessible from userspace
commit a5463cd3435475386cbbe7b06e01292ac169d36f upstream. If kuser helpers are not provided by the kernel, disable user access to the vectors page. With the kuser helpers gone, there is no reason for this page to be visible to userspace. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/process.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 72315e7be22b..1ed29cc22979 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -433,6 +433,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
433} 433}
434 434
435#ifdef CONFIG_MMU 435#ifdef CONFIG_MMU
436#ifdef CONFIG_KUSER_HELPERS
436/* 437/*
437 * The vectors page is always readable from user space for the 438 * The vectors page is always readable from user space for the
438 * atomic helpers. Insert it into the gate_vma so that it is visible 439 * atomic helpers. Insert it into the gate_vma so that it is visible
@@ -465,10 +466,14 @@ int in_gate_area_no_mm(unsigned long addr)
465{ 466{
466 return in_gate_area(NULL, addr); 467 return in_gate_area(NULL, addr);
467} 468}
469#define is_gate_vma(vma) ((vma) = &gate_vma)
470#else
471#define is_gate_vma(vma) 0
472#endif
468 473
469const char *arch_vma_name(struct vm_area_struct *vma) 474const char *arch_vma_name(struct vm_area_struct *vma)
470{ 475{
471 return (vma == &gate_vma) ? "[vectors]" : 476 return is_gate_vma(vma) ? "[vectors]" :
472 (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ? 477 (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ?
473 "[sigpage]" : NULL; 478 "[sigpage]" : NULL;
474} 479}