aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libsandbox: new powerpc ptrace portMike Frysinger2015-12-202-0/+32
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: new alpha ptrace portMike Frysinger2015-12-202-0/+60
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: new arm ptrace portMike Frysinger2015-12-202-0/+24
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: new s390/s390x ptrace portMike Frysinger2015-12-202-0/+97
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: improve sparc trace code a bit moreMike Frysinger2015-12-201-8/+26
| | | | | | | This gets most of the tests passing, but syscall canceling still does not work. Need to talk to upstream to figure it out. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: avoid mixing stderr & output pipesMike Frysinger2015-12-201-3/+3
| | | | | | | | | | | | The various debug helpers were changed to write out to a dedicated message path, but some of the trace code still uses stderr directly. When mixing these methods, the direct prints would sometimes be lost. Convert the few users to a new raw print function so they all route through the same file. We might want to extract this a bit more out in the future so it's easier to write to them, but this should be fine for now. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: switch to PTRACE_O_TRACEEXECMike Frysinger2015-12-191-2/+6
| | | | | | | | | | Rather than try to deal with the inconsistent cross-arch behavior when it comes to tracking exec behavior, use the PTRACE_O_TRACEEXEC option. This means we only support ptrace on linux-2.6+ systems, but that's fine as we have been requiring that for a long time now. It also means the code is much simpler and stable across arches. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: rework abi syscall header generationMike Frysinger2015-09-201-0/+6
| | | | | | | | | | Probe the availability of multilib headers at configure time so that we can show the status more cleanly. This allows the header generation to be done in parallel and not output confusing warning messages to users. URL: https://bugs.gentoo.org/536582 Reported-by: cmue81@gmx.de Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: fix hppa trace codeMike Frysinger2012-07-061-2/+2
| | | | | | URL: https://bugs.gentoo.org/425062 Reported-by: Jeroen Roovers <jer@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: add x32 ABI supportv2.6Mike Frysinger2012-07-032-3/+55
| | | | | | | | | | | We can trace x32 when the host is x86_64 or x32, but x32 cannot trace x86_64 due to limitations in the kernel interface -- all pointers get truncated to 32bits. We'll have to add external ptrace helpers in the future to make this work, but for now, we'll just let x86_64 code run unchecked :(. URL: https://bugs.gentoo.org/394179 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: migrate to get/set regs interface for everyoneMike Frysinger2012-07-038-68/+72
| | | | | | | | | | Newer ports (like x32) limit what is available via the peek/poke user interface, and instead are pushing people to use the single get/set regs interface. Since this also simplifies the code a bit (by forcing all ports to use this), and cuts down on the number of syscalls that we have to make, switch everyone over to it. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* significantly overhaul output helpersMike Frysinger2012-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | There are a few major points we want to hit here: - have all output from libsandbox go through portage helpers when we are in the portage environment so that output is properly logged - convert SB_E{info,warn,error} to sb_e{info,warn,error} to match style of other functions and cut down on confusion - move all abort/output helpers to libsbutil so it can be used in all source trees and not just by libsandbox - migrate all abort points to the centralized sb_ebort helper Unfortunately, it's not terribly easy to untangle these into separate patches, but hopefully this shouldn't be too messy as much of it is mechanical: move funcs between files, and change the name of funcs that get called. URL: http://bugs.gentoo.org/278761 Reported-by: Mounir Lamouri <volkmar@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: set syscall error rather than killing on violationsMike Frysinger2012-03-066-12/+43
| | | | | | | | | | | | | | | If we kill the app, then the syscall that we flagged as a violation will complete, and our entire purpose has failed -- to prevent modifications to the protected paths. Instead, set the syscall number to an invalid one, continue the syscall, then set the syscall return value (which will become the errno) after the syscall finishes. This way the bad syscall isn't actually executed, and we let the app continue to run like normal. URL: http://bugs.gentoo.org/406543 Reported-by: Marijn Schouten <hkbst@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: disable sparc ptrace until it can be debugged furtherMike Frysinger2010-08-151-0/+5
| | | | | | URL: http://bugs.gentoo.org/293632 Reported-by: Raúl Porcel <armin76@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: add support for tracing SPARC systemsMike Frysinger2009-10-253-0/+32
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: add support for tracing Blackfin/PARISC systemsMike Frysinger2009-04-085-5/+67
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* libsandbox: enable tracing for multiple personalitiesMike Frysinger2009-04-052-10/+92
| | | | | | | | | Initial support for tracing non-default personalities. For example, tracing a 32bit binary from a 64bit environment. URL: http://bugs.gentoo.org/264399 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Reported-by: Patrick Lauer <patrick@gentoo.org>
* libsandbox: initial support for tracing of static binaries via ptrace()Mike Frysinger2009-03-186-0/+95
Signed-off-by: Mike Frysinger <vapier@gentoo.org>