diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 15 | ||||
-rw-r--r-- | arch/arm/kernel/kprobes-decode.c | 7 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 21 |
3 files changed, 38 insertions, 5 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 2d23ad985180..8bfa98757cd2 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -334,7 +334,6 @@ ENTRY(vector_swi) | |||
334 | 334 | ||
335 | get_thread_info tsk | 335 | get_thread_info tsk |
336 | adr tbl, sys_call_table @ load syscall table pointer | 336 | adr tbl, sys_call_table @ load syscall table pointer |
337 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
338 | 337 | ||
339 | #if defined(CONFIG_OABI_COMPAT) | 338 | #if defined(CONFIG_OABI_COMPAT) |
340 | /* | 339 | /* |
@@ -351,8 +350,20 @@ ENTRY(vector_swi) | |||
351 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number | 350 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number |
352 | #endif | 351 | #endif |
353 | 352 | ||
353 | ldr r10, [tsk, #TI_FLAGS] @ check for syscall tracing | ||
354 | stmdb sp!, {r4, r5} @ push fifth and sixth args | 354 | stmdb sp!, {r4, r5} @ push fifth and sixth args |
355 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | 355 | |
356 | #ifdef CONFIG_SECCOMP | ||
357 | tst r10, #_TIF_SECCOMP | ||
358 | beq 1f | ||
359 | mov r0, scno | ||
360 | bl __secure_computing | ||
361 | add r0, sp, #S_R0 + S_OFF @ pointer to regs | ||
362 | ldmia r0, {r0 - r3} @ have to reload r0 - r3 | ||
363 | 1: | ||
364 | #endif | ||
365 | |||
366 | tst r10, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | ||
356 | bne __sys_trace | 367 | bne __sys_trace |
357 | 368 | ||
358 | cmp scno, #NR_syscalls @ check upper syscall limit | 369 | cmp scno, #NR_syscalls @ check upper syscall limit |
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c index 8bccbfa693ff..2c1f0050c9c4 100644 --- a/arch/arm/kernel/kprobes-decode.c +++ b/arch/arm/kernel/kprobes-decode.c | |||
@@ -1162,11 +1162,12 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
1162 | { | 1162 | { |
1163 | /* | 1163 | /* |
1164 | * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx | 1164 | * MSR : cccc 0011 0x10 xxxx xxxx xxxx xxxx xxxx |
1165 | * Undef : cccc 0011 0x00 xxxx xxxx xxxx xxxx xxxx | 1165 | * Undef : cccc 0011 0100 xxxx xxxx xxxx xxxx xxxx |
1166 | * ALU op with S bit and Rd == 15 : | 1166 | * ALU op with S bit and Rd == 15 : |
1167 | * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx | 1167 | * cccc 001x xxx1 xxxx 1111 xxxx xxxx xxxx |
1168 | */ | 1168 | */ |
1169 | if ((insn & 0x0f900000) == 0x03200000 || /* MSR & Undef */ | 1169 | if ((insn & 0x0fb00000) == 0x03200000 || /* MSR */ |
1170 | (insn & 0x0ff00000) == 0x03400000 || /* Undef */ | ||
1170 | (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */ | 1171 | (insn & 0x0e10f000) == 0x0210f000) /* ALU s-bit, R15 */ |
1171 | return INSN_REJECTED; | 1172 | return INSN_REJECTED; |
1172 | 1173 | ||
@@ -1177,7 +1178,7 @@ space_cccc_001x(kprobe_opcode_t insn, struct arch_specific_insn *asi) | |||
1177 | * *S (bit 20) updates condition codes | 1178 | * *S (bit 20) updates condition codes |
1178 | * ADC/SBC/RSC reads the C flag | 1179 | * ADC/SBC/RSC reads the C flag |
1179 | */ | 1180 | */ |
1180 | insn &= 0xfff00fff; /* Rn = r0, Rd = r0 */ | 1181 | insn &= 0xffff0fff; /* Rd = r0 */ |
1181 | asi->insn[0] = insn; | 1182 | asi->insn[0] = insn; |
1182 | asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */ | 1183 | asi->insn_handler = (insn & (1 << 20)) ? /* S-bit */ |
1183 | emulate_alu_imm_rwflags : emulate_alu_imm_rflags; | 1184 | emulate_alu_imm_rwflags : emulate_alu_imm_rflags; |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 3af34bf4f4df..e76fcaadce03 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -482,3 +482,24 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) | |||
482 | unsigned long range_end = mm->brk + 0x02000000; | 482 | unsigned long range_end = mm->brk + 0x02000000; |
483 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | 483 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; |
484 | } | 484 | } |
485 | |||
486 | /* | ||
487 | * The vectors page is always readable from user space for the | ||
488 | * atomic helpers and the signal restart code. Let's declare a mapping | ||
489 | * for it so it is visible through ptrace and /proc/<pid>/mem. | ||
490 | */ | ||
491 | |||
492 | int vectors_user_mapping(void) | ||
493 | { | ||
494 | struct mm_struct *mm = current->mm; | ||
495 | return install_special_mapping(mm, 0xffff0000, PAGE_SIZE, | ||
496 | VM_READ | VM_EXEC | | ||
497 | VM_MAYREAD | VM_MAYEXEC | | ||
498 | VM_ALWAYSDUMP | VM_RESERVED, | ||
499 | NULL); | ||
500 | } | ||
501 | |||
502 | const char *arch_vma_name(struct vm_area_struct *vma) | ||
503 | { | ||
504 | return (vma->vm_start == 0xffff0000) ? "[vectors]" : NULL; | ||
505 | } | ||