summaryrefslogtreecommitdiffstats
path: root/arch/csky/kernel/ptrace.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-06 10:15:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-06 10:15:28 -0700
commit2044513ffe4a9c18e6e2a64f048e05d8b62fa927 (patch)
tree011f45466c3fd87a9efa4f4b57188297e7c24d93 /arch/csky/kernel/ptrace.c
parentbbcf9cd1576752ebe8d618ad8c6500b7e262ffac (diff)
parentbdcd93ef9afb42a6051e472fa62c693b1f9edbd8 (diff)
Merge tag 'csky-for-linus-5.9-rc1' of https://github.com/c-sky/csky-linux
Pull arch/csky updates from Guo Ren: "New features: - seccomp-filter - err-injection - top-down&random mmap-layout - irq_work - show_ipi - context-tracking Fixes & Optimizations: - kprobe_on_ftrace - optimize panic print" * tag 'csky-for-linus-5.9-rc1' of https://github.com/c-sky/csky-linux: csky: Add context tracking support csky: Add arch_show_interrupts for IPI interrupts csky: Add irq_work support csky: Fixup warning by EXPORT_SYMBOL(kmap) csky: Set CONFIG_NR_CPU 4 as default csky: Use top-down mmap layout csky: Optimize the trap processing flow csky: Add support for function error injection csky: Fixup kprobes handler couldn't change pc csky: Fixup duplicated restore sp in RESTORE_REGS_FTRACE csky: Add cpu feature register hint for smp csky: Add SECCOMP_FILTER supported csky: remove unusued thread_saved_pc and *_segments functions/macros
Diffstat (limited to 'arch/csky/kernel/ptrace.c')
-rw-r--r--arch/csky/kernel/ptrace.c37
1 files changed, 8 insertions, 29 deletions
diff --git a/arch/csky/kernel/ptrace.c b/arch/csky/kernel/ptrace.c
index 944ca2fdcdd9..b06612c408c4 100644
--- a/arch/csky/kernel/ptrace.c
+++ b/arch/csky/kernel/ptrace.c
@@ -320,16 +320,20 @@ long arch_ptrace(struct task_struct *child, long request,
return ret;
}
-asmlinkage void syscall_trace_enter(struct pt_regs *regs)
+asmlinkage int syscall_trace_enter(struct pt_regs *regs)
{
if (test_thread_flag(TIF_SYSCALL_TRACE))
if (tracehook_report_syscall_entry(regs))
- syscall_set_nr(current, regs, -1);
+ return -1;
+
+ if (secure_computing() == -1)
+ return -1;
if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
trace_sys_enter(regs, syscall_get_nr(current, regs));
audit_syscall_entry(regs_syscallid(regs), regs->a0, regs->a1, regs->a2, regs->a3);
+ return 0;
}
asmlinkage void syscall_trace_exit(struct pt_regs *regs)
@@ -343,13 +347,8 @@ asmlinkage void syscall_trace_exit(struct pt_regs *regs)
trace_sys_exit(regs, syscall_get_return_value(current, regs));
}
-extern void show_stack(struct task_struct *task, unsigned long *stack, const char *loglvl);
void show_regs(struct pt_regs *fp)
{
- unsigned long *sp;
- unsigned char *tp;
- int i;
-
pr_info("\nCURRENT PROCESS:\n\n");
pr_info("COMM=%s PID=%d\n", current->comm, current->pid);
@@ -396,29 +395,9 @@ void show_regs(struct pt_regs *fp)
fp->regs[0], fp->regs[1], fp->regs[2], fp->regs[3]);
pr_info("r10: 0x%08lx r11: 0x%08lx r12: 0x%08lx r13: 0x%08lx\n",
fp->regs[4], fp->regs[5], fp->regs[6], fp->regs[7]);
- pr_info("r14: 0x%08lx r1: 0x%08lx r15: 0x%08lx\n",
- fp->regs[8], fp->regs[9], fp->lr);
+ pr_info("r14: 0x%08lx r1: 0x%08lx\n",
+ fp->regs[8], fp->regs[9]);
#endif
- pr_info("\nCODE:");
- tp = ((unsigned char *) fp->pc) - 0x20;
- tp += ((int)tp % 4) ? 2 : 0;
- for (sp = (unsigned long *) tp, i = 0; (i < 0x40); i += 4) {
- if ((i % 0x10) == 0)
- pr_cont("\n%08x: ", (int) (tp + i));
- pr_cont("%08x ", (int) *sp++);
- }
- pr_cont("\n");
-
- pr_info("\nKERNEL STACK:");
- tp = ((unsigned char *) fp) - 0x40;
- for (sp = (unsigned long *) tp, i = 0; (i < 0xc0); i += 4) {
- if ((i % 0x10) == 0)
- pr_cont("\n%08x: ", (int) (tp + i));
- pr_cont("%08x ", (int) *sp++);
- }
- pr_cont("\n");
-
- show_stack(NULL, (unsigned long *)fp->regs[4], KERN_INFO);
return;
}