diff options
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 7b9cddef6e53..2b7b017a20cd 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -528,21 +528,39 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
528 | #ifdef CONFIG_MMU | 528 | #ifdef CONFIG_MMU |
529 | /* | 529 | /* |
530 | * The vectors page is always readable from user space for the | 530 | * The vectors page is always readable from user space for the |
531 | * atomic helpers and the signal restart code. Let's declare a mapping | 531 | * atomic helpers and the signal restart code. Insert it into the |
532 | * for it so it is visible through ptrace and /proc/<pid>/mem. | 532 | * gate_vma so that it is visible through ptrace and /proc/<pid>/mem. |
533 | */ | 533 | */ |
534 | static struct vm_area_struct gate_vma; | ||
534 | 535 | ||
535 | int vectors_user_mapping(void) | 536 | static int __init gate_vma_init(void) |
536 | { | 537 | { |
537 | struct mm_struct *mm = current->mm; | 538 | gate_vma.vm_start = 0xffff0000; |
538 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | 539 | gate_vma.vm_end = 0xffff0000 + PAGE_SIZE; |
539 | VM_READ | VM_EXEC | | 540 | gate_vma.vm_page_prot = PAGE_READONLY_EXEC; |
540 | VM_MAYREAD | VM_MAYEXEC | VM_RESERVED, | 541 | gate_vma.vm_flags = VM_READ | VM_EXEC | |
541 | NULL); | 542 | VM_MAYREAD | VM_MAYEXEC; |
543 | return 0; | ||
544 | } | ||
545 | arch_initcall(gate_vma_init); | ||
546 | |||
547 | struct vm_area_struct *get_gate_vma(struct mm_struct *mm) | ||
548 | { | ||
549 | return &gate_vma; | ||
550 | } | ||
551 | |||
552 | int in_gate_area(struct mm_struct *mm, unsigned long addr) | ||
553 | { | ||
554 | return (addr >= gate_vma.vm_start) && (addr < gate_vma.vm_end); | ||
555 | } | ||
556 | |||
557 | int in_gate_area_no_mm(unsigned long addr) | ||
558 | { | ||
559 | return in_gate_area(NULL, addr); | ||
542 | } | 560 | } |
543 | 561 | ||
544 | const char *arch_vma_name(struct vm_area_struct *vma) | 562 | const char *arch_vma_name(struct vm_area_struct *vma) |
545 | { | 563 | { |
546 | return (vma->vm_start == 0xffff0000) ? "[vectors]" : NULL; | 564 | return (vma == &gate_vma) ? "[vectors]" : NULL; |
547 | } | 565 | } |
548 | #endif | 566 | #endif |