Revert "Revert "CHROMIUM: arch/arm: move secure_computing into trace; respect return code""
This reverts commit a25e94221e
.
Change-Id: Ic0f0e2a217656f5500058760cbde35277f50c09c
This commit is contained in:
parent
487905d4b3
commit
4a740604d9
|
@ -452,12 +452,7 @@ ENTRY(vector_swi)
|
||||||
|
|
||||||
#ifdef CONFIG_SECCOMP
|
#ifdef CONFIG_SECCOMP
|
||||||
tst r10, #_TIF_SECCOMP
|
tst r10, #_TIF_SECCOMP
|
||||||
beq 1f
|
bne __sys_trace
|
||||||
mov r0, scno
|
|
||||||
bl __secure_computing
|
|
||||||
add r0, sp, #S_R0 + S_OFF @ pointer to regs
|
|
||||||
ldmia r0, {r0 - r3} @ have to reload r0 - r3
|
|
||||||
1:
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls?
|
tst r10, #_TIF_SYSCALL_WORK @ are we tracing syscalls?
|
||||||
|
|
|
@ -910,12 +910,16 @@ long arch_ptrace(struct task_struct *child, long request,
|
||||||
asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
||||||
{
|
{
|
||||||
unsigned long ip;
|
unsigned long ip;
|
||||||
|
current_thread_info()->syscall = scno;
|
||||||
|
|
||||||
if (why)
|
if (why)
|
||||||
audit_syscall_exit(regs);
|
audit_syscall_exit(regs);
|
||||||
else
|
else {
|
||||||
|
if (secure_computing(scno) == -1)
|
||||||
|
return -1;
|
||||||
audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
|
audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
|
||||||
regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
|
regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
|
||||||
|
}
|
||||||
|
|
||||||
if (why == 0 && test_and_clear_thread_flag(TIF_SYSCALL_RESTARTSYS))
|
if (why == 0 && test_and_clear_thread_flag(TIF_SYSCALL_RESTARTSYS))
|
||||||
scno = __NR_restart_syscall - __NR_SYSCALL_BASE;
|
scno = __NR_restart_syscall - __NR_SYSCALL_BASE;
|
||||||
|
@ -924,7 +928,12 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
|
||||||
if (!(current->ptrace & PT_PTRACED))
|
if (!(current->ptrace & PT_PTRACED))
|
||||||
return scno;
|
return scno;
|
||||||
|
|
||||||
current_thread_info()->syscall = scno;
|
/*
|
||||||
|
* IP is used to denote syscall entry/exit:
|
||||||
|
* IP = 0 -> entry, =1 -> exit
|
||||||
|
*/
|
||||||
|
ip = regs->ARM_ip;
|
||||||
|
regs->ARM_ip = why;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IP is used to denote syscall entry/exit:
|
* IP is used to denote syscall entry/exit:
|
||||||
|
|
Loading…
Reference in New Issue