]> git.eshelyaron.com Git - emacs.git/commitdiff
Correct crash in child processes under armeabi Android
authorPo Lu <luangruo@yahoo.com>
Mon, 18 Sep 2023 06:13:30 +0000 (14:13 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 18 Sep 2023 06:16:39 +0000 (14:16 +0800)
* 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>.

exec/trace.c

index 3b384792d0a4efdfda8cbd5a3c3497f89011cf6b..f9deef8eb2d39668708c082a6694b8ae47896c65 100644 (file)
@@ -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, &regs, 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, &regs, 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.  */