diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 15 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 21 |
2 files changed, 34 insertions, 2 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 7885722bdf4e..0385a8207b67 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -295,7 +295,6 @@ ENTRY(vector_swi) | |||
295 | 295 | ||
296 | get_thread_info tsk | 296 | get_thread_info tsk |
297 | adr tbl, sys_call_table @ load syscall table pointer | 297 | adr tbl, sys_call_table @ load syscall table pointer |
298 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
299 | 298 | ||
300 | #if defined(CONFIG_OABI_COMPAT) | 299 | #if defined(CONFIG_OABI_COMPAT) |
301 | /* | 300 | /* |
@@ -312,8 +311,20 @@ ENTRY(vector_swi) | |||
312 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number | 311 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number |
313 | #endif | 312 | #endif |
314 | 313 | ||
314 | ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
315 | stmdb sp!, {r4, r5} @ push fifth and sixth args | 315 | stmdb sp!, {r4, r5} @ push fifth and sixth args |
316 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | 316 | |
317 | #ifdef CONFIG_SECCOMP | ||
318 | tst r10, #_TIF_SECCOMP | ||
319 | beq 1f | ||
320 | mov r0, scno | ||
321 | bl __secure_computing | ||
322 | add r0, sp, #S_R0 + S_OFF @ pointer to regs | ||
323 | ldmia r0, {r0 - r3} @ have to reload r0 - r3 | ||
324 | 1: | ||
325 | #endif | ||
326 | |||
327 | tst r10, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | ||
317 | bne __sys_trace | 328 | bne __sys_trace |
318 | 329 | ||
319 | cmp scno, #NR_syscalls @ check upper syscall limit | 330 | cmp scno, #NR_syscalls @ check upper syscall limit |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 401e38be1f78..66ac9c926200 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -458,3 +458,24 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
458 | unsigned long range_end = mm->brk + 0x02000000; | 458 | unsigned long range_end = mm->brk + 0x02000000; |
459 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | 459 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; |
460 | } | 460 | } |
461 | |||
462 | /* | ||
463 | * The vectors page is always readable from user space for the | ||
464 | * atomic helpers and the signal restart code. Let's declare a mapping | ||
465 | * for it so it is visible through ptrace and /proc/<pid>/mem. | ||
466 | */ | ||
467 | |||
468 | int vectors_user_mapping(void) | ||
469 | { | ||
470 | struct mm_struct *mm = current->mm; | ||
471 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | ||
472 | VM_READ | VM_EXEC | | ||
473 | VM_MAYREAD | VM_MAYEXEC | | ||
474 | VM_ALWAYSDUMP | VM_RESERVED, | ||
475 | NULL); | ||
476 | } | ||
477 | |||
478 | const char *arch_vma_name(struct vm_area_struct *vma) | ||
479 | { | ||
480 | return (vma->vm_start == 0xffff0000) ? "[vectors]" : NULL; | ||
481 | } | ||