diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2014-04-30 05:51:29 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-05-12 11:43:28 -0400 |
commit | 449f81a4da4d99980064943d504bb19d07e86aec (patch) | |
tree | aeeef0f1054efa57e68a7ec71c5cc614796a014a /arch | |
parent | 2a2830703a2371b47f7b50b1d35cb15dc0e2b717 (diff) |
arm64: make a single hook to syscall_trace() for all syscall features
Currently syscall_trace() is called only for ptrace.
With additional TIF_xx flags defined, it is now called in all the cases
of audit, ftrace and seccomp in addition to ptrace.
Acked-by: Richard Guy Briggs <rgb@redhat.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/include/asm/thread_info.h | 13 | ||||
-rw-r--r-- | arch/arm64/kernel/entry.S | 5 |
2 files changed, 16 insertions, 2 deletions
diff --git a/arch/arm64/include/asm/thread_info.h b/arch/arm64/include/asm/thread_info.h index 720e70b66ffd..0a8b2a97a32e 100644 --- a/arch/arm64/include/asm/thread_info.h +++ b/arch/arm64/include/asm/thread_info.h | |||
@@ -91,6 +91,9 @@ static inline struct thread_info *current_thread_info(void) | |||
91 | /* | 91 | /* |
92 | * thread information flags: | 92 | * thread information flags: |
93 | * TIF_SYSCALL_TRACE - syscall trace active | 93 | * TIF_SYSCALL_TRACE - syscall trace active |
94 | * TIF_SYSCALL_TRACEPOINT - syscall tracepoint for ftrace | ||
95 | * TIF_SYSCALL_AUDIT - syscall auditing | ||
96 | * TIF_SECOMP - syscall secure computing | ||
94 | * TIF_SIGPENDING - signal pending | 97 | * TIF_SIGPENDING - signal pending |
95 | * TIF_NEED_RESCHED - rescheduling necessary | 98 | * TIF_NEED_RESCHED - rescheduling necessary |
96 | * TIF_NOTIFY_RESUME - callback before returning to user | 99 | * TIF_NOTIFY_RESUME - callback before returning to user |
@@ -101,6 +104,9 @@ static inline struct thread_info *current_thread_info(void) | |||
101 | #define TIF_NEED_RESCHED 1 | 104 | #define TIF_NEED_RESCHED 1 |
102 | #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ | 105 | #define TIF_NOTIFY_RESUME 2 /* callback before returning to user */ |
103 | #define TIF_SYSCALL_TRACE 8 | 106 | #define TIF_SYSCALL_TRACE 8 |
107 | #define TIF_SYSCALL_AUDIT 9 | ||
108 | #define TIF_SYSCALL_TRACEPOINT 10 | ||
109 | #define TIF_SECCOMP 11 | ||
104 | #define TIF_POLLING_NRFLAG 16 | 110 | #define TIF_POLLING_NRFLAG 16 |
105 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ | 111 | #define TIF_MEMDIE 18 /* is terminating due to OOM killer */ |
106 | #define TIF_FREEZE 19 | 112 | #define TIF_FREEZE 19 |
@@ -112,10 +118,17 @@ static inline struct thread_info *current_thread_info(void) | |||
112 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 118 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
113 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 119 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
114 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 120 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
121 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | ||
122 | #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) | ||
123 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) | ||
124 | #define _TIF_SECCOMP (1 << TIF_SECCOMP) | ||
115 | #define _TIF_32BIT (1 << TIF_32BIT) | 125 | #define _TIF_32BIT (1 << TIF_32BIT) |
116 | 126 | ||
117 | #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ | 127 | #define _TIF_WORK_MASK (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \ |
118 | _TIF_NOTIFY_RESUME) | 128 | _TIF_NOTIFY_RESUME) |
119 | 129 | ||
130 | #define _TIF_SYSCALL_WORK (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \ | ||
131 | _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP) | ||
132 | |||
120 | #endif /* __KERNEL__ */ | 133 | #endif /* __KERNEL__ */ |
121 | #endif /* __ASM_THREAD_INFO_H */ | 134 | #endif /* __ASM_THREAD_INFO_H */ |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index e8b23a3b68d0..be95f3544ce4 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -610,8 +610,9 @@ el0_svc_naked: // compat entry point | |||
610 | stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number | 610 | stp x0, scno, [sp, #S_ORIG_X0] // save the original x0 and syscall number |
611 | enable_dbg_and_irq | 611 | enable_dbg_and_irq |
612 | 612 | ||
613 | ldr x16, [tsk, #TI_FLAGS] // check for syscall tracing | 613 | ldr x16, [tsk, #TI_FLAGS] // check for syscall hooks |
614 | tbnz x16, #TIF_SYSCALL_TRACE, __sys_trace // are we tracing syscalls? | 614 | tst x16, #_TIF_SYSCALL_WORK |
615 | b.ne __sys_trace | ||
615 | adr lr, ret_fast_syscall // return address | 616 | adr lr, ret_fast_syscall // return address |
616 | cmp scno, sc_nr // check upper syscall limit | 617 | cmp scno, sc_nr // check upper syscall limit |
617 | b.hs ni_sys | 618 | b.hs ni_sys |