diff options
author | Helge Deller <deller@gmx.de> | 2022-11-29 12:08:20 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2023-03-10 20:45:47 +0100 |
commit | 895ce8bb534e66ca418dea62ae67a92dccafb2e1 (patch) | |
tree | 6d9292795056aa8d2650f34ad0837dfa64046fba /linux-user/strace.c | |
parent | fe080593dd4f2c2763f7c27a3ba6e69b64fe3b0c (diff) | |
download | qemu-895ce8bb534e66ca418dea62ae67a92dccafb2e1.zip qemu-895ce8bb534e66ca418dea62ae67a92dccafb2e1.tar.gz qemu-895ce8bb534e66ca418dea62ae67a92dccafb2e1.tar.bz2 |
linux-user: Emulate CLONE_PIDFD flag in clone()
Add emulation for the CLONE_PIDFD flag of the clone() syscall.
This flag was added in Linux kernel 5.2.
Successfully tested on a x86-64 Linux host with hppa-linux target.
Can be verified by running the testsuite of the qcoro debian package,
which breaks hard and kills the currently logged-in user without this
patch.
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <Y4XoJCpvUA1JD7Sj@p100>
[lv: define CLONE_PIDFD if it is not]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/strace.c')
-rw-r--r-- | linux-user/strace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/strace.c b/linux-user/strace.c index e08bd53..aad2b62 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -1111,11 +1111,16 @@ UNUSED static const struct flags mmap_flags[] = { FLAG_END, }; +#ifndef CLONE_PIDFD +# define CLONE_PIDFD 0x00001000 +#endif + UNUSED static const struct flags clone_flags[] = { FLAG_GENERIC(CLONE_VM), FLAG_GENERIC(CLONE_FS), FLAG_GENERIC(CLONE_FILES), FLAG_GENERIC(CLONE_SIGHAND), + FLAG_GENERIC(CLONE_PIDFD), FLAG_GENERIC(CLONE_PTRACE), FLAG_GENERIC(CLONE_VFORK), FLAG_GENERIC(CLONE_PARENT), |