aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/process.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-07-31 16:58:56 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-08-01 09:31:58 -0400
commita5463cd3435475386cbbe7b06e01292ac169d36f (patch)
tree71a32103b6df2be4fac877c60cdda2d9fe46e3a5 /arch/arm/kernel/process.c
parent48be69a026b2c17350a5ef18a1959a919f60be7d (diff)
ARM: make vectors page inaccessible from userspace
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>
Diffstat (limited to 'arch/arm/kernel/process.c')
-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 566d0d71a1e7..1e6c33d01c05 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -426,6 +426,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
426} 426}
427 427
428#ifdef CONFIG_MMU 428#ifdef CONFIG_MMU
429#ifdef CONFIG_KUSER_HELPERS
429/* 430/*
430 * The vectors page is always readable from user space for the 431 * The vectors page is always readable from user space for the
431 * atomic helpers. Insert it into the gate_vma so that it is visible 432 * atomic helpers. Insert it into the gate_vma so that it is visible
@@ -458,10 +459,14 @@ int in_gate_area_no_mm(unsigned long addr)
458{ 459{
459 return in_gate_area(NULL, addr); 460 return in_gate_area(NULL, addr);
460} 461}
462#define is_gate_vma(vma) ((vma) = &gate_vma)
463#else
464#define is_gate_vma(vma) 0
465#endif
461 466
462const char *arch_vma_name(struct vm_area_struct *vma) 467const char *arch_vma_name(struct vm_area_struct *vma)
463{ 468{
464 return (vma == &gate_vma) ? "[vectors]" : 469 return is_gate_vma(vma) ? "[vectors]" :
465 (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ? 470 (vma->vm_mm && vma->vm_start == vma->vm_mm->context.sigpage) ?
466 "[sigpage]" : NULL; 471 "[sigpage]" : NULL;
467} 472}