···3232 | score: | TODO |3333 | sh: | TODO |3434 | sparc: | TODO |3535- | tile: | TODO |3535+ | tile: | ok |3636 | um: | TODO |3737 | unicore32: | TODO |3838 | x86: | ok |
+17
arch/tile/Kconfig
···3232 select EDAC_SUPPORT3333 select GENERIC_STRNCPY_FROM_USER3434 select GENERIC_STRNLEN_USER3535+ select HAVE_ARCH_SECCOMP_FILTER35363637# FIXME: investigate whether we need/want these options.3738# select HAVE_IOREMAP_PROT···221220 ---help---222221 If enabled, the kernel will support running TILE-Gx binaries223222 that were built with the -m32 option.223223+224224+config SECCOMP225225+ bool "Enable seccomp to safely compute untrusted bytecode"226226+ depends on PROC_FS227227+ help228228+ This kernel feature is useful for number crunching applications229229+ that may need to compute untrusted bytecode during their230230+ execution. By using pipes or other transports made available to231231+ the process as file descriptors supporting the read/write232232+ syscalls, it's possible to isolate those applications in233233+ their own address space using seccomp. Once seccomp is234234+ enabled via prctl, it cannot be disabled and the task is only235235+ allowed to execute a few safe syscalls defined by each seccomp236236+ mode.237237+238238+ If unsure, say N.224239225240config SYSVIPC_COMPAT226241 def_bool y
···2222#include <arch/chip.h>23232424#include <linux/ptrace.h>2525+#include <linux/elf-em.h>2526#include <asm/byteorder.h>2627#include <asm/page.h>2728···30293130#define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))3231typedef elf_greg_t elf_gregset_t[ELF_NGREG];3333-3434-#define EM_TILEPRO 1883535-#define EM_TILEGX 19136323733/* Provide a nominal data structure. */3834#define ELF_NFPREG 0
+27-1
arch/tile/include/asm/syscall.h
···20202121#include <linux/sched.h>2222#include <linux/err.h>2323+#include <linux/audit.h>2424+#include <linux/compat.h>2325#include <arch/abi.h>24262527/* The array of function pointers for syscalls. */···6361 struct pt_regs *regs,6462 int error, long val)6563{6666- regs->regs[0] = (long) error ?: val;6464+ if (error) {6565+ /* R0 is the passed-in negative error, R1 is positive. */6666+ regs->regs[0] = error;6767+ regs->regs[1] = -error;6868+ } else {6969+ /* R1 set to zero to indicate no error. */7070+ regs->regs[0] = val;7171+ regs->regs[1] = 0;7272+ }6773}68746975static inline void syscall_get_arguments(struct task_struct *task,···9080{9181 BUG_ON(i + n > 6);9282 memcpy(®s[i], args, n * sizeof(args[0]));8383+}8484+8585+/*8686+ * We don't care about endianness (__AUDIT_ARCH_LE bit) here because8787+ * tile has the same system calls both on little- and big- endian.8888+ */8989+static inline int syscall_get_arch(void)9090+{9191+ if (is_compat_task())9292+ return AUDIT_ARCH_TILEGX32;9393+9494+#ifdef CONFIG_TILEGX9595+ return AUDIT_ARCH_TILEGX;9696+#else9797+ return AUDIT_ARCH_TILEPRO;9898+#endif9399}9410095101#endif /* _ASM_TILE_SYSCALL_H */
+1
arch/tile/kernel/intvec_32.S
···12241224 jal do_syscall_trace_enter12251225 }12261226 FEEDBACK_REENTER(handle_syscall)12271227+ blz r0, .Lsyscall_sigreturn_skip1227122812281229 /*12291230 * We always reload our registers from the stack at this
+1
arch/tile/kernel/intvec_64.S
···12471247 jal do_syscall_trace_enter12481248 }12491249 FEEDBACK_REENTER(handle_syscall)12501250+ bltz r0, .Lsyscall_sigreturn_skip1250125112511252 /*12521253 * We always reload our registers from the stack at this
+3
arch/tile/kernel/ptrace.c
···262262 if (work & _TIF_NOHZ)263263 user_exit();264264265265+ if (secure_computing() == -1)266266+ return -1;267267+265268 if (work & _TIF_SYSCALL_TRACE) {266269 if (tracehook_report_syscall_entry(regs))267270 regs->regs[TREG_SYSCALL_NR] = -1;