aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel/ptrace.c
AgeCommit message (Collapse)Author
2009-01-22MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatc ↵merge
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141 pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
2008-09-12sparc: Fix user_regset 'n' field values.David S. Miller
As noticed by Russell King, we were not setting this properly to the number of entries, but rather the total size. This results in the core dumping code allocating waayyyy too much memory. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-24sparc64: Split syscall_trace() into two functions.David S. Miller
Christoph Hellwig noticed that having both entry and exit logic in one function no longer makes sense, and having seperate ones simplifies things a lot. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-27sparc64: tracehook syscallRoland McGrath
This changes sparc64 syscall tracing to use the new tracehook.h entry points. [ Add assembly changes to force an immediate -ENOSYS return from the system call when syscall_trace() returns non-zero at syscall entry. -DaveM ] Signed-off-by: Roland McGrath <roland@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix debugger syscall restart interactions.David S. Miller
So, forever, we've had this ptrace_signal_deliver implementation which tries to handle all of the nasties that can occur when the debugger looks at a process about to take a signal. It's meant to address all of these issues inside of the kernel so that the debugger need not be mindful of such things. Problem is, this doesn't work. The idea was that we should do the syscall restart business first, so that the debugger captures that state. Otherwise, if the debugger for example saves the child's state, makes the child execute something else, then restores the saved state, we won't handle the syscall restart properly because we lose the "we're in a syscall" state. The code here worked for most cases, but if the debugger actually passes the signal through to the child unaltered, it's possible that we would do a syscall restart when we shouldn't have. In particular this breaks the case of debugging a process under a gdb which is being debugged by yet another gdb. gdb uses sigsuspend to wait for SIGCHLD of the inferior, but if gdb itself is being debugged by a top-level gdb we get a ptrace_stop(). The top-level gdb does a PTRACE_CONT with SIGCHLD to let the inferior gdb see the signal. But ptrace_signal_deliver() assumed the debugger would cancel out the signal and therefore did a syscall restart, because the return error was ERESTARTNOHAND. Fix this by simply making ptrace_signal_deliver() a nop, and providing a way for the debugger to control system call restarting properly: 1) Report a "in syscall" software bit in regs->{tstate,psr}. It is set early on in trap entry to a system call and is fully visible to the debugger via ptrace() and regsets. 2) Test this bit right before doing a syscall restart. We have to do a final recheck right after get_signal_to_deliver() in case the debugger cleared the bit during ptrace_stop(). 3) Clear the bit in trap return so we don't accidently try to set that bit in the real register. As a result we also get a ptrace_{is,clear}_syscall() for sparc32 just like sparc64 has. M68K has this same exact bug, and is now the only other user of the ptrace_signal_deliver hook. It needs to be fixed in the same exact way as sparc. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-05-11sparc: Fix ptrace() detach.David S. Miller
Forever we had a PTRACE_SUNOS_DETACH which was unconditionally recognized, regardless of the personality of the process. Unfortunately, this value is what ended up in the GLIBC sys/ptrace.h header file on sparc as PTRACE_DETACH and PT_DETACH. So continue to recognize this old value. Luckily, it doesn't conflict with anything we actually care about. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-09[SPARC]: Fix several regset and ptrace bugs.David S. Miller
1) ptrace should pass 'current' to task_user_regset_view() 2) When fetching general registers using a 64-bit view, and the target is 32-bit, we have to convert. 3) Skip the whole register window get/set code block if the user isn't asking to access anything in there. Otherwise we have problems if the user doesn't have an address space setup. Fetching ptrace register is still valid at such a time, and ptrace does not try to access the register window area of the regset. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-03[SPARC64]: Fix user accesses in regset code.David S. Miller
If target is not current we need to use access_process_vm(). Noticed by Roland McGrath. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-26[SPARC64]: flush_ptrace_access() needs preemption disable.David S. Miller
Based upon a report by Mariusz Kozlowski. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-26[SPARC64]: Fix allnoconfig build, ptrace.c missing CONFIG_COMPAT checks.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-26[SPARC64]: Fix sparse warnings in arch/sparc64/kernel/ptrace.cDavid S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC64]: Make use of compat_sys_ptrace()David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC64]: Use regsets in arch_ptrace().David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC64]: Remove unintentional ptrace debugging messages.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC]: Move over to arch_ptrace().David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC]: Remove PTRACE_SUN* handling.David S. Miller
Supporting SunOS ptrace() is pretty pointless and these kinds of quirks keep us from being able to share more code with other platforms. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC]: Kill DEBUG_PTRACE code.David S. Miller
It has long exceeded it's usefulness. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-02-07[SPARC64]: Add user regsets.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-10[SPARC{32,64}]: Propagate ptrace_traceme() return value.Alexey Dobriyan
ptrace_traceme() consolidation made ret = ptrace_traceme(); dead write. Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-05-01[PATCH] drop task argument of audit_syscall_{entry,exit}Al Viro
... it's always current, and that's a good thing - allows simpler locking. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2006-04-09[SPARC64]: Translate PTRACE_GETEVENTMSG for 32-bit tasks.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-04-09[SPARC64]: Add dummy PTRACE_PEEKUSR for gdb.David S. Miller
GDB uses a PTRACE_PEEKUSR call with offset 0 to see if a thread is alive, so provide a success return for this particular special case. Signed-off-by: David S. Miller <davem@davemloft.net>
2006-03-20[SPARC64]: Don't do anything in flush_ptrace_access() on SUN4V.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2006-01-12[PATCH] sparc64: task_pt_regs()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-12[PATCH] sparc64: task_thread_info()Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-08[PATCH] use ptrace_get_task_struct in various placesChristoph Hellwig
The ptrace_get_task_struct() helper that I added as part of the ptrace consolidation is useful in variety of places that currently opencode it. Switch them to the common helpers. Add a ptrace_traceme() helper that needs to be explicitly called, and simplify the ptrace_get_task_struct() interface. We don't need the request argument now, and we return the task_struct directly, using ERR_PTR() for error returns. It's a bit more code in the callers, but we have two sane routines that do one thing well now. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-29[SPARC64]: Fix several bugs in flush_ptrace_access().David S. Miller
1) Use cpudata cache line sizes, not magic constants. 2) Align start address in cheetah case so we do not get unaligned address traps. (pgrep was good at triggering this, via /proc/${pid}/cmdline accesses) Signed-off-by: David S. Miller <davem@davemloft.net>
2005-09-19[SPARC64]: Move DCACHE_ALIASING_POSSIBLE define to asm/page.hDavid S. Miller
This showed that arch/sparc64/kernel/ptrace.c was not getting the define properly, and thus the code protected by this ifdef was never actually compiled before. So fix that too. Signed-off-by: David S. Miller <davem@davemloft.net>
2005-07-10[SPARC64]: Add syscall auditing support.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-07-10[SPARC64]: Pass regs and entry/exit boolean to syscall_trace()David S. Miller
Also fix a bug in 32-bit syscall tracing. We forgot to update this code when we moved over to the convention that all 32-bit syscall arguments are zero extended by default. Signed-off-by: David S. Miller <davem@davemloft.net>
2005-07-10[SPARC64]: Add SECCOMP support.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-05-01[PATCH] convert that currently tests _NSIG directly to use valid_signal()Jesper Juhl
Convert most of the current code that uses _NSIG directly to instead use valid_signal(). This avoids gcc -W warnings and off-by-one errors. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] sparc64: Reduce ptrace cache flushingDavid S. Miller
We were flushing the D-cache excessively for ptrace() processing and this makes debugging threads so slow as to be totally unusable. All process page accesses via ptrace() go via access_process_vm(). This routine, for each process page, uses get_user_pages(). That in turn does a flush_dcache_page() on the child pages before we copy in/out the ptrace request data. Therefore, all we need to do after the data movement is: 1) Flush the D-cache pages if the kernel maps the page to a different color than userspace does. 2) If we wrote to the page, we need to flush the I-cache on older cpus. Previously we just flushed the entire cache at the end of a ptrace() request, and that was beyond stupid. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-17[PATCH] sparc: Fix PTRACE_CONT bogosityDavid S. Miller
SunOS aparently had this weird PTRACE_CONT semantic which we copied. If the addr argument is something other than 1, it sets the process program counter to whatever that value is. This is different from every other Linux architecture, which don't do anything with the addr and data args. This difference in particular breaks the Linux native GDB support for fork and vfork tracing on sparc and sparc64. There is no interest in running SunOS binaries using this weird PTRACE_CONT behavior, so just delete it so we behave like other platforms do. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-04-16Linux-2.6.12-rc2Linus Torvalds
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!