summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/ptrace_64.c
Commit message (Collapse)AuthorAgeFilesLines
* signal: Remove task parameter from force_sigEric W. Biederman2019-05-271-2/+2
| | | | | | | | | | All of the remaining callers pass current into force_sig so remove the task parameter to make this obvious and to make misuse more difficult in the future. This also makes it clear force_sig passes current into force_sig_info. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
* sh: kernel: convert to SPDX identifiersKuninori Morimoto2018-12-281-4/+1Star
| | | | | | | | | | | | | Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/8736rccswn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Cc: Rich Felker <dalias@libc.org> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* sched/headers: Prepare for new header dependencies before moving code to ↵Ingo Molnar2017-03-021-0/+1
| | | | | | | | | | | | | | | | | | | | <linux/sched/task_stack.h> We are going to split <linux/sched/task_stack.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/task_stack.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
* Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds2016-12-241-1/+1
| | | | | | | | | | | | | This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ARCH: AUDIT: audit_syscall_entry() should not require the archEric Paris2014-09-231-16/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | We have a function where the arch can be queried, syscall_get_arch(). So rather than have every single piece of arch specific code use and/or duplicate syscall_get_arch(), just have the audit code use the syscall_get_arch() code. Based-on-patch-by: Richard Briggs <rgb@redhat.com> Signed-off-by: Eric Paris <eparis@redhat.com> Cc: linux-alpha@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-ia64@vger.kernel.org Cc: microblaze-uclinux@itee.uq.edu.au Cc: linux-mips@linux-mips.org Cc: linux@lists.openrisc.net Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: user-mode-linux-devel@lists.sourceforge.net Cc: linux-xtensa@linux-xtensa.org Cc: x86@kernel.org
* seccomp: ignore secure_computing return valuesWill Drewry2012-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | This change is inspired by https://lkml.org/lkml/2012/4/16/14 which fixes the build warnings for arches that don't support CONFIG_HAVE_ARCH_SECCOMP_FILTER. In particular, there is no requirement for the return value of secure_computing() to be checked unless the architecture supports seccomp filter. Instead of silencing the warnings with (void) a new static inline is added to encode the expected behavior in a compiler and human friendly way. v2: - cleans things up with a static inline - removes sfr's signed-off-by since it is a different approach v1: - matches sfr's original change Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Will Drewry <wad@chromium.org> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: James Morris <james.l.morris@oracle.com>
* Disintegrate asm/system.h for SHDavid Howells2012-03-281-1/+1
| | | | | | | Disintegrate asm/system.h for SH. Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-sh@vger.kernel.org
* audit: inline audit_syscall_entry to reduce burden on archsEric Paris2012-01-171-4/+3Star
| | | | | | | | | | | | | Every arch calls: if (unlikely(current->audit_context)) audit_syscall_entry() which requires knowledge about audit (the existance of audit_context) in the arch code. Just do it all in static inline in audit.h so that arch's can remain blissfully ignorant. Signed-off-by: Eric Paris <eparis@redhat.com>
* Audit: push audit success and retcode into arch ptrace.hEric Paris2012-01-171-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The audit system previously expected arches calling to audit_syscall_exit to supply as arguments if the syscall was a success and what the return code was. Audit also provides a helper AUDITSC_RESULT which was supposed to simplify things by converting from negative retcodes to an audit internal magic value stating success or failure. This helper was wrong and could indicate that a valid pointer returned to userspace was a failed syscall. The fix is to fix the layering foolishness. We now pass audit_syscall_exit a struct pt_reg and it in turns calls back into arch code to collect the return value and to determine if the syscall was a success or failure. We also define a generic is_syscall_success() macro which determines success/failure based on if the value is < -MAX_ERRNO. This works for arches like x86 which do not use a separate mechanism to indicate syscall failure. We make both the is_syscall_success() and regs_return_value() static inlines instead of macros. The reason is because the audit function must take a void* for the regs. (uml calls theirs struct uml_pt_regs instead of just struct pt_regs so audit_syscall_exit can't take a struct pt_regs). Since the audit function takes a void* we need to use static inlines to cast it back to the arch correct structure to dereference it. The other major change is that on some arches, like ia64, MIPS and ppc, we change regs_return_value() to give us the negative value on syscall failure. THE only other user of this macro, kretprobe_example.c, won't notice and it makes the value signed consistently for the audit functions across all archs. In arch/sh/kernel/ptrace_64.c I see that we were using regs[9] in the old audit code as the return value. But the ptrace_64.h code defined the macro regs_return_value() as regs[3]. I have no idea which one is correct, but this patch now uses the regs_return_value() function, so it now uses regs[3]. For powerpc we previously used regs->result but now use the regs_return_value() function which uses regs->gprs[3]. regs->gprs[3] is always positive so the regs_return_value(), much like ia64 makes it negative before calling the audit code when appropriate. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: H. Peter Anvin <hpa@zytor.com> [for x86 portion] Acked-by: Tony Luck <tony.luck@intel.com> [for ia64] Acked-by: Richard Weinberger <richard@nod.at> [for uml] Acked-by: David S. Miller <davem@davemloft.net> [for sparc] Acked-by: Ralf Baechle <ralf@linux-mips.org> [for mips] Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [for ppc]
* sh: Fix ptrace fpu state initialisationPhil Edworthy2011-03-231-0/+6
| | | | | | | | | | | Commit 0ea820cf introduced the PTRACE_GETFPREGS/SETFPREGS cmds, but gdb-server still accesses the FPU state using the PTRACE_PEEKUSR/POKEUSR commands. In this case, xstate was not initialised. Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Cc: stable@kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* ptrace: cleanup arch_ptrace() on shNamhyung Kim2010-10-281-7/+12
| | | | | | | | | | | Remove unnecessary castings and get rid of dummy pointer in favor of offsetof() macro in ptrace_32.c. Also use temporary variables and break long lines in order to improve readability. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ptrace: change signature of arch_ptrace()Namhyung Kim2010-10-281-2/+4
| | | | | | | | | | | | | | | Fix up the arguments to arch_ptrace() to take account of the fact that @addr and @data are now unsigned long rather than long as of a preceding patch in this series. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Cc: <linux-arch@vger.kernel.org> Acked-by: Roland McGrath <roland@redhat.com> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* sh: kill big kernel lockArnd Bergmann2010-09-161-6/+3Star
| | | | | | | | | | The only BKL user in arch/sh protects a single bit, so we can trivially replace it with test_and_set_bit. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Paul Mundt <lethal@linux-sh.org> Cc: linux-sh@vger.kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Add kprobe-based event tracer.Paul Mundt2010-06-141-0/+79
| | | | | | | | This follows the x86/ppc changes for kprobe-based event tracing on sh. While kprobes is only supported on 32-bit sh, we provide the API for HAVE_REGS_AND_STACK_ACCESS_API for both 32 and 64-bit. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* Merge branch 'sh/stable-updates'Paul Mundt2010-02-151-2/+9
|\
| * sh64: fix tracing of signals.Paul Mundt2010-02-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This follows the parisc change to ensure that tracehook_signal_handler() is aware of when we are single-stepping in order to ptrace_notify() appropriately. While this was implemented for 32-bit SH, sh64 neglected to make use of TIF_SINGLESTEP when it was folded in with the 32-bit code, resulting in ptrace_notify() never being called. As sh64 uses all of the other abstractions already, this simply plugs in the thread flag in the appropriate enable/disable paths and fixes up the tracehook notification accordingly. With this in place, sh64 is brought in line with what 32-bit is already doing. Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh64: Fixup build breakage from breakpoint handler rename.Paul Mundt2010-01-191-2/+3
| | | | | | | | | | | | | | The breakpoint handler was renamed on sh32, but sh64 was overlooked in the conversion. Fix it up now. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh64: Use the shared FPU state restorer.Paul Mundt2010-01-191-2/+1Star
| | | | | | | | | | | | | | This kills off the sh64-specific state restorer and switches over to the generic one. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* | sh64: Fix up the build for the thread_xstate changes.Paul Mundt2010-01-191-5/+5
|/ | | | | | | This updates the sh64 processor info with the sh32 changes in order to tie in to the generic task_xstate management code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up FPU build for SH5Matt Fleming2009-12-151-2/+2
| | | | | | | | After the recent FPU optimisation commit the signature of save_fpu() changed. "regs" wasn't used in the implementation of save_fpu() anyway. Signed-off-by: Matt Fleming <matt@console-pimps.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Wire up HAVE_SYSCALL_TRACEPOINTS.Paul Mundt2009-09-161-0/+9
| | | | | | | | This is necessary to get ftrace syscall tracing working again.. a fairly trivial and mechanical change. The one benefit is that this can also be enabled on sh64, despite not having its own ftrace port. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Provide linux/regset.h interface for SH-5.Paul Mundt2008-12-221-1/+185
| | | | | | Plugs in general and FPU regsets. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: fixup many sparse errors.Paul Mundt2008-09-081-0/+1
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: fix ptrace_64.c:user_disable_single_step()Adrian Bunk2008-08-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch fixes the following compile error caused by commit c459dbf294b4a3d70490a468a7ca3907fb2c2f57 (sh: ptrace single stepping cleanups.): <-- snip --> ... CC arch/sh/kernel/ptrace_64.o arch/sh/kernel/ptrace_64.c: In function 'user_disable_single_step': arch/sh/kernel/ptrace_64.c:134: error: 'regs' undeclared (first use in this function) arch/sh/kernel/ptrace_64.c:134: error: (Each undeclared identifier is reported only once arch/sh/kernel/ptrace_64.c:134: error: for each function it appears in.) ... make[2]: *** [arch/sh/kernel/ptrace_64.o] Error 1 <-- snip --> Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Fix up the audit arch endian specification.Paul Mundt2008-08-011-1/+15
| | | | | | | | Presently this was always being set to AUDIT_ARCH_SH, which assumes big endian. Fix this up so that the architecture actually reflects what we're running on. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Make syscall tracer use tracehook notifiers, add TIF_NOTIFY_RESUME.Paul Mundt2008-08-011-26/+24Star
| | | | | | | | | | | | | | This follows the changes in commits: 7d6d637dac2050f30a1b57b0a3dc5de4a10616ba 4f72c4279eab1e5f3ed1ac4e55d4527617582392 on powerpc. Adding in TIF_NOTIFY_RESUME, and cleaning up the syscall tracing to be more generic. This is an incremental step to turning on tracehook, as well as unifying more of the ptrace and signal code across the 32/64 split. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: ptrace single stepping cleanups.Paul Mundt2008-08-011-65/+12Star
| | | | | | | | This converts the single stepping done by sh/sh64 ptrace implementations to use the generic user_enable/disable_single_step(), and subsequently rips out a lot of ptrace request cases that are now handled generically. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: seccomp support.Paul Mundt2008-08-011-0/+3
| | | | | | | This hooks up the seccomp thread flag and associated callback from the syscall tracer. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh64: add missing #include <asm/fpu.h>'sAdrian Bunk2008-04-151-0/+1
| | | | | | | | | | This patch fixes some compile errors due to missing save_fpu() prototypes on sh64 caused by commit 9bbafce2eec190ef7e44b0eb1095ba17ce6ad3af (sh: Fix occasional FPU register corruption under preempt). Signed-off-by: Adrian Bunk <adrian.bunk@movial.fi> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: syscall auditing for sh5, too.Paul Mundt2008-01-281-14/+24
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Bring the SH-5 FPU in line with the SH-4 FPU API.Paul Mundt2008-01-281-2/+2
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Move quad-word real-address I/O defs to io.h.Paul Mundt2008-01-281-1/+0Star
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Have SH-5 provide an {en,dis}able_fpu() impl.Paul Mundt2008-01-281-4/+4
| | | | Signed-off-by: Paul Mundt <lethal@linux-sh.org>
* sh: Move in the SH-5 ptrace impl.Paul Mundt2008-01-281-0/+332
Signed-off-by: Paul Mundt <lethal@linux-sh.org>