diff options
| author | Po Lu | 2023-09-18 14:13:30 +0800 |
|---|---|---|
| committer | Po Lu | 2023-09-18 14:16:39 +0800 |
| commit | cd69120731f3407a4ba8c62cc195edaf411134ce (patch) | |
| tree | 9b11f78a1e8ac15cec1089d033d855292b690800 /exec | |
| parent | b892da5f615306c04d9d1b2e95954d14e1481752 (diff) | |
| download | emacs-cd69120731f3407a4ba8c62cc195edaf411134ce.tar.gz emacs-cd69120731f3407a4ba8c62cc195edaf411134ce.zip | |
Correct crash in child processes under armeabi Android
* 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>.
Diffstat (limited to 'exec')
| -rw-r--r-- | exec/trace.c | 22 |
1 files 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) | |||
| 1039 | #endif /* READLINK_SYSCALL */ | 1039 | #endif /* READLINK_SYSCALL */ |
| 1040 | case READLINKAT_SYSCALL: | 1040 | case READLINKAT_SYSCALL: |
| 1041 | 1041 | ||
| 1042 | /* Handle this readlinkat system call. */ | 1042 | /* This system call is already in progress if |
| 1043 | rc = handle_readlinkat (callno, ®s, tracee, | 1043 | TRACEE->waiting_for_syscall is true. */ |
| 1044 | &result); | ||
| 1045 | 1044 | ||
| 1046 | /* rc means the same as in `handle_exec'. */ | 1045 | if (!tracee->waiting_for_syscall) |
| 1046 | { | ||
| 1047 | /* Handle this readlinkat system call. */ | ||
| 1048 | rc = handle_readlinkat (callno, ®s, tracee, | ||
| 1049 | &result); | ||
| 1050 | |||
| 1051 | /* rc means the same as in `handle_exec'. */ | ||
| 1047 | 1052 | ||
| 1048 | if (rc == 1) | 1053 | if (rc == 1) |
| 1049 | goto report_syscall_error; | 1054 | goto report_syscall_error; |
| 1050 | else if (rc == 2) | 1055 | else if (rc == 2) |
| 1051 | goto emulate_syscall; | 1056 | goto emulate_syscall; |
| 1057 | } | ||
| 1052 | 1058 | ||
| 1053 | /* Fallthrough. */ | 1059 | /* Fallthrough. */ |
| 1054 | 1060 | ||