From cd69120731f3407a4ba8c62cc195edaf411134ce Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 18 Sep 2023 14:13:30 +0800 Subject: [PATCH] Correct crash in child processes under armeabi Android MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * exec/trace.c (process_system_call) : 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 . --- exec/trace.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/exec/trace.c b/exec/trace.c index 3b384792d0a..f9deef8eb2d 100644 --- a/exec/trace.c +++ b/exec/trace.c @@ -1039,16 +1039,22 @@ process_system_call (struct exec_tracee *tracee) #endif /* READLINK_SYSCALL */ case READLINKAT_SYSCALL: - /* Handle this readlinkat system call. */ - rc = handle_readlinkat (callno, ®s, tracee, - &result); + /* This system call is already in progress if + TRACEE->waiting_for_syscall is true. */ - /* rc means the same as in `handle_exec'. */ + if (!tracee->waiting_for_syscall) + { + /* Handle this readlinkat system call. */ + rc = handle_readlinkat (callno, ®s, tracee, + &result); + + /* rc means the same as in `handle_exec'. */ - if (rc == 1) - goto report_syscall_error; - else if (rc == 2) - goto emulate_syscall; + if (rc == 1) + goto report_syscall_error; + else if (rc == 2) + goto emulate_syscall; + } /* Fallthrough. */ -- 2.39.2