[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/22] linux-user/strace: Add output for execveat() syscall
From: |
Laurent Vivier |
Subject: |
[PULL 03/22] linux-user/strace: Add output for execveat() syscall |
Date: |
Sat, 4 Feb 2023 17:08:11 +0100 |
From: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Message-Id: <20221104081015.706009-1-sir@cmpwn.com>
Suggested-by: Helge Deller <deller@gmx.de>
[PMD: Split of bigger patch]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20221104173632.1052-4-philmd@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
linux-user/strace.c | 23 +++++++++++++++++++++++
linux-user/strace.list | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index 3d11d2f75978..7bccb4f0c067 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -1104,6 +1104,16 @@ UNUSED static const struct flags clone_flags[] = {
FLAG_END,
};
+UNUSED static const struct flags execveat_flags[] = {
+#ifdef AT_EMPTY_PATH
+ FLAG_GENERIC(AT_EMPTY_PATH),
+#endif
+#ifdef AT_SYMLINK_NOFOLLOW
+ FLAG_GENERIC(AT_SYMLINK_NOFOLLOW),
+#endif
+ FLAG_END,
+};
+
UNUSED static const struct flags msg_flags[] = {
/* send */
FLAG_GENERIC(MSG_CONFIRM),
@@ -1976,6 +1986,19 @@ print_execve(CPUArchState *cpu_env, const struct
syscallname *name,
print_syscall_epilogue(name);
}
+static void
+print_execveat(CPUArchState *cpu_env, const struct syscallname *name,
+ abi_long arg1, abi_long arg2, abi_long arg3,
+ abi_long arg4, abi_long arg5, abi_long arg6)
+{
+ print_syscall_prologue(name);
+ print_at_dirfd(arg1, 0);
+ print_string(arg2, 0);
+ print_execve_argv(arg3, 0);
+ print_flags(execveat_flags, arg5, 1);
+ print_syscall_epilogue(name);
+}
+
#if defined(TARGET_NR_faccessat) || defined(TARGET_NR_faccessat2)
static void
print_faccessat(CPUArchState *cpu_env, const struct syscallname *name,
diff --git a/linux-user/strace.list b/linux-user/strace.list
index 3a898e2532d3..bb21c054148e 100644
--- a/linux-user/strace.list
+++ b/linux-user/strace.list
@@ -164,7 +164,7 @@
{ TARGET_NR_execve, "execve" , NULL, print_execve, NULL },
#endif
#ifdef TARGET_NR_execveat
-{ TARGET_NR_execveat, "execveat" , NULL, NULL, NULL },
+{ TARGET_NR_execveat, "execveat" , NULL, print_execveat, NULL },
#endif
#ifdef TARGET_NR_exec_with_loader
{ TARGET_NR_exec_with_loader, "exec_with_loader" , NULL, NULL, NULL },
--
2.39.1
- [PULL 06/22] linux-user: Add missing MAP_HUGETLB and MAP_STACK flags in strace, (continued)
- [PULL 06/22] linux-user: Add missing MAP_HUGETLB and MAP_STACK flags in strace, Laurent Vivier, 2023/02/04
- [PULL 02/22] linux-user/strace: Extract print_execve_argv() from print_execve(), Laurent Vivier, 2023/02/04
- [PULL 10/22] Revert "linux-user: add more compat ioctl definitions", Laurent Vivier, 2023/02/04
- [PULL 17/22] linux-user: Improve strace output of personality() and sysinfo(), Laurent Vivier, 2023/02/04
- [PULL 15/22] linux-user: Fix SO_ERROR return code of getsockopt(), Laurent Vivier, 2023/02/04
- [PULL 11/22] Revert "linux-user: fix compat with glibc >= 2.36 sys/mount.h", Laurent Vivier, 2023/02/04
- [PULL 19/22] linux-user: Show 4th argument of rt_sigprocmask() in strace, Laurent Vivier, 2023/02/04
- [PULL 22/22] linux-user: Allow sendmsg() without IOV, Laurent Vivier, 2023/02/04
- [PULL 20/22] linux-user: Enhance strace output for various syscalls, Laurent Vivier, 2023/02/04
- [PULL 09/22] linux-user: add more netlink protocol constants, Laurent Vivier, 2023/02/04
- [PULL 03/22] linux-user/strace: Add output for execveat() syscall,
Laurent Vivier <=
- [PULL 04/22] linux-user/syscall: Extract do_execve() from do_syscall1(), Laurent Vivier, 2023/02/04
- [PULL 05/22] linux-user/syscall: Implement execveat(), Laurent Vivier, 2023/02/04
- [PULL 18/22] linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise(), Laurent Vivier, 2023/02/04
- [PULL 16/22] linux-user: Fix /proc/cpuinfo output for hppa, Laurent Vivier, 2023/02/04
- [PULL 13/22] linux-user: Improve strace output of getgroups() and setgroups(), Laurent Vivier, 2023/02/04
- [PULL 21/22] linux-user: Implement SOL_ALG encryption support, Laurent Vivier, 2023/02/04
- [PULL 08/22] linux-user: fix strace build w/out munlockall, Laurent Vivier, 2023/02/04
- [PULL 14/22] linux-user: move target_flat.h to target subdirs, Laurent Vivier, 2023/02/04
- [PULL 12/22] linux-user: Add strace output for clock_getres_time64() and futex_time64(), Laurent Vivier, 2023/02/04
- Re: [PULL 00/22] Linux user for 8.0 patches, Peter Maydell, 2023/02/04