aboutsummaryrefslogtreecommitdiffstats
path: root/exec/trace.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * exec/trace.c (rpl_stpcpy): Replace stpcpy if absent.Po Lu2024-03-141-0/+30
|
* Improve /proc/self/exe substitution on AndroidPo Lu2024-03-141-10/+111
| | | | | | | | | | | | * exec/configure.ac (USER_SWORD): New macro. * exec/exec.c (format_pid): Export this function. * exec/exec.h: * exec/trace.c (canon_path): New function. (handle_readlinkat, handle_openat): Test complete file name against /proc/self/exe, and further check for /proc/pid/exe.
* Intercept calls to `openat' under AndroidPo Lu2024-01-271-1/+134
| | | | | | | | | | | | * exec/configure.ac (OPEN_SYSCALL, OPENAT_SYSCALL): Define new macros. * exec/exec.h (struct exec_tracee): New field `sp'. * exec/trace.c (handle_openat): New function. (process_system_call): If handle_openat executes successfully, save the unmodified stack pointer within the tracee structure to be restored once the system call completes.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Fix typosStefan Kangas2023-12-101-1/+1
|
* Correct crash in child processes under armeabi AndroidPo Lu2023-09-181-8/+14
| | | | | | | * exec/trace.c (process_system_call) <READLINKAT_SYSCALL>: Examine tracee->waiting_for_syscall and avoid rewriting user arguments if a system call is presently being executed by the kernel. Reported by Romário Rios <romariorios@protonmail.com>.
* Update Android portPo Lu2023-07-201-3/+3
| | | | | | | * exec/trace.c (handle_readlinkat): Adjust commentary to match behavior. * src/android.c (android_get_keysym_name): NULL terminate *name_return.
* Remove arbitrary process count limitPo Lu2023-05-201-0/+12
| | | | | | * exec/trace.c (handle_clone_prepare): (handle_clone): When !REENTRANT, use malloc to allocate tracees after running out of static ones.
* Fix execution of /proc/self/exe within child processesPo Lu2023-05-051-38/+149
| | | | | | | | | | | | | | * exec/exec.h (struct exec_tracee): New field `new_child'. Also, make `waiting_for_syscall' a bitfield. * exec/trace.c (PTRACE_GETEVENTMSG): New declaration. (MAX_TRACEES): Bump to 4096. (handle_clone_prepare): New function. (handle_clone): If required, set `new_child' and wait for a ptrace event describing the parent to arrive. (after_fork): Clear new field. (exec_waitpid): Upon a ptrace event describing a clone, create the child's tracee if it doesn't already exist. Otherwise, copy over the parent's cmdline and start running it.
* Update Android portPo Lu2023-05-051-0/+4
| | | | * exec/trace.c (SYS_SECCOMP): Define when not present.
* Update Android portPo Lu2023-05-041-21/+97
| | | | | | * exec/trace.c (check_signal): New function. (handle_exec, process_system_call): Handle signal-delivery-stop while waiting synchronously for syscall completion.
* Update Android portPo Lu2023-05-031-0/+25
| | | | | | | | * exec/config.h.in: Autoheader. * exec/configure.ac: Check for siginfo_t.si_syscall. * exec/trace.c (exec_waitpid): If SIGSYS is received, and caused by seccomp, drop it should the call number be the invalid system call used by Emacs.
* Update Android portPo Lu2023-05-031-1/+43
| | | | | | | | | * exec/config.h.in: Autoheader. * exec/configure.ac: Use system extensions. (HAVE_PROCESS_VM): Define if process_vm_readv and process_vm_writev are available. * exec/trace.c (read_memory, user_copy): Implement in terms of process_vm if possible.
* Update Android portPo Lu2023-05-021-4/+164
| | | | | | | | | | | | | | * exec/config.h.in (__bool_true_false_are_defined): * exec/configure.ac (REENTRANT): New definition. (READLINKAT_SYSCALL, READLINK_SYSCALL): New defines. Set on all hosts. * exec/exec.c (MIN, MAX): Remove redundant declarations. Move to config.h. (exec_0): Copy name of executable into NAME when !REENTRANT. * exec/exec.h (struct exec_tracee): New struct `exec_file'. * exec/trace.c (remove_tracee, handle_exec, handle_readlinkat) (process_system_call, after_fork): Handle readlinkat system calls.
* Fix cwd relative process execution on AndroidPo Lu2023-05-011-14/+25
| | | | | | | | * exec/exec.c (format_pid): New function. (exec_0): Make cwd relative file names relative to /proc/pid/cwd. * exec/trace.c (handle_exec): Handle EINTR. (process_system_call): Report failure without clobbering x0.
* Fix syscall error reporting on aarch64Po Lu2023-05-011-1/+20
| | | | | | * exec/trace.c (process_system_call): Save and restore x0, x1 and x2 regs after replacing them with an invalid file descriptor.
* Add helper binary `exec1'Po Lu2023-04-301-0/+972
* .gitignore: New files. * Makefile.in (mostlyclean_dirs): Add libexec, if its Makefile exists. * autogen.sh (do_git): Autoreconf in exec as well. * configure.ac: Configure libexec on Android. * exec/Makefile.in: * exec/README: * exec/config-mips.m4.in: * exec/config.guess: * exec/config.h.in: * exec/config.sub: * exec/configure: * exec/configure.ac: * exec/deps.mk: * exec/exec.c (MIN, struct exec_open_command) (struct exec_map_command, struct exec_jump_command) (write_open_command, write_load_command, process_interpreter_1) (process_interpreter, process_program_header, insert_args) (exec_0): * exec/exec.h (_EXEC_H_, struct elf_header_32) (struct program_header_32, struct dt_entry_32) (struct elf_header_64, struct program_header_64) (struct dt_entry_64, struct exec_tracee): * exec/exec1.c (main): * exec/install-sh (scriptversion): * exec/loader-aarch64.s (_start): * exec/loader-armeabi.s (_start): * exec/loader-mips64el.s (__start): * exec/loader-mipsel.s (__start): * exec/loader-x86.s (_start): * exec/loader-x86_64.s (_start): * exec/mipsel-user.h (_MIPSEL_USER_H_): * exec/mipsfpu.c (MIPS_ABI_FP_ANY, fpu_reqs, valid_abi_p) (fp_mode_for_abi, cpu_supports_fr0_p, determine_fpu_mode): * exec/mipsfpu.h (_MIPSFPU_H_, FP_FR0): * exec/test.c (print_usage, main): * exec/trace.c (MAX_TRACEES, aarch64_set_regs, read_memory) (user_alloca, user_copy, remove_tracee, handle_clone) (syscall_trap_p, handle_exec, process_system_call, tracing_execve) (after_fork, find_tracee, exec_waitpid, exec_init): New files. * java/Makefile.in (CROSS_EXEC_BINS): Add exec1 and loader. ($(CROSS_EXEC_BINS) &): New target.