[PATCH v3 3/7] Load /proc/$pid/comm into tcb
Masatake YAMATO
yamato at redhat.com
Thu Sep 9 13:43:33 UTC 2021
In preparation for the forthcoming -Y,--decode-pids=comm option.
Load the content of /proc/$pid/comm to `comm', a newly introduced
member of tcb.
The loading is done when
A. a tcb is initialized,
B. execve or execveat is called, and
C. prctl(PR_SET_NAME,...) is called.
Limitation: this change is not enough for handling the case that
someone writes a value to /proc/$pid/comm directly.
(e.g. running echo "foo" > /proc/$pid/comm)
* src/defs.h (struct tcb): New member `comm'.
(enum pid_decoding_flags): Add PID_DECODING_COMM as new flag.
(PROC_COMM_LEN): New definition.
(maybe_load_task_comm): New function declaration.
* src/strace.c (load_task_comm): New function loading the
content of /proc/$pid/comm to `comm' member of tcb.
(maybe_load_pid_comm): New helper function for load_task_comm().
(alloctcb): Call load_task_comm() for initializing the `comm' member.
* src/syscall.c: include <linux/prctl.h> for referring PR_SET_NAME.
(syscall_exiting_decode): Call maybe_load_task_comm().
* src/sysent.h (COMM_CHANGE): New definition.
* src/sysent_shorthand_defs.h (CC): New definition.
* src/sysent_shorthand_undefs.h (CC): Add undef.
* src/linux/32/syscallent.h: Add CC flag to syscalls chaning
/proc/$pid/comm.
* linux/64/syscallent.h: Likewise.
* linux/alpha/syscallent.h: Likewise.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent-n32.h: Likewise.
* linux/mips/syscallent-n64.h: Likewise.
* linux/mips/syscallent-o32.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* linux/xtensa/syscallent.h: Likewise.
* src/filter_seccomp.c (traced_by_seccomp): Force tracing syscalls
marked with `COMM_CHANGE' if `PID_DECODING_COMM' is set in
`pid_decoding' is set.
Signed-off-by: Masatake YAMATO <yamato at redhat.com>
---
src/defs.h | 5 +++++
src/filter_seccomp.c | 3 ++-
src/linux/32/syscallent.h | 6 +++---
src/linux/64/syscallent.h | 6 +++---
src/linux/alpha/syscallent.h | 6 +++---
src/linux/arm/syscallent.h | 6 +++---
src/linux/avr32/syscallent.h | 6 +++---
src/linux/bfin/syscallent.h | 6 +++---
src/linux/hppa/syscallent.h | 6 +++---
src/linux/i386/syscallent.h | 6 +++---
src/linux/ia64/syscallent.h | 6 +++---
src/linux/m68k/syscallent.h | 6 +++---
src/linux/microblaze/syscallent.h | 6 +++---
src/linux/mips/syscallent-n32.h | 6 +++---
src/linux/mips/syscallent-n64.h | 6 +++---
src/linux/mips/syscallent-o32.h | 6 +++---
src/linux/powerpc/syscallent.h | 6 +++---
src/linux/powerpc64/syscallent.h | 6 +++---
src/linux/s390/syscallent.h | 6 +++---
src/linux/s390x/syscallent.h | 6 +++---
src/linux/sh/syscallent.h | 6 +++---
src/linux/sh64/syscallent.h | 6 +++---
src/linux/sparc/syscallent.h | 6 +++---
src/linux/sparc64/syscallent.h | 6 +++---
src/linux/x32/syscallent.h | 6 +++---
src/linux/x86_64/syscallent.h | 6 +++---
src/linux/xtensa/syscallent.h | 6 +++---
src/strace.c | 35 +++++++++++++++++++++++++++++++
src/syscall.c | 8 +++++++
src/sysent.h | 1 +
src/sysent_shorthand_defs.h | 2 ++
src/sysent_shorthand_undefs.h | 1 +
32 files changed, 129 insertions(+), 76 deletions(-)
diff --git a/src/defs.h b/src/defs.h
index fdc89579c..71a40f88e 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -322,6 +322,9 @@ struct tcb {
void *unwind_ctx;
struct unwind_queue_t *unwind_queue;
# endif
+
+# define PROC_COMM_LEN 16
+ char comm[PROC_COMM_LEN];
};
/* TCB flags */
@@ -508,6 +511,7 @@ extern bool count_wallclock;
extern unsigned int pid_decoding;
enum pid_decoding_flags {
PID_DECODING_NS_TRANSLATION = 1 << 0,
+ PID_DECODING_COMM = 1 << 1,
};
/* are we filtering traces based on paths? */
extern struct path_set {
@@ -1933,4 +1937,5 @@ print_big_u64_addr(const uint64_t addr)
# include "syscall.h"
# endif
+void maybe_load_task_comm(struct tcb *tcp);
#endif /* !STRACE_DEFS_H */
diff --git a/src/filter_seccomp.c b/src/filter_seccomp.c
index 6c9056c33..7af6309cb 100644
--- a/src/filter_seccomp.c
+++ b/src/filter_seccomp.c
@@ -283,7 +283,8 @@ traced_by_seccomp(unsigned int scno, unsigned int p)
{
unsigned int always_trace_flags =
TRACE_INDIRECT_SUBCALL | TRACE_SECCOMP_DEFAULT |
- (stack_trace_enabled ? MEMORY_MAPPING_CHANGE : 0);
+ (stack_trace_enabled ? MEMORY_MAPPING_CHANGE : 0) |
+ ((pid_decoding & PID_DECODING_COMM) ? COMM_CHANGE : 0);
return sysent_vec[p][scno].sys_flags & always_trace_flags ||
is_number_in_set_array(scno, trace_set, p);
}
diff --git a/src/linux/32/syscallent.h b/src/linux/32/syscallent.h
index 032d365d1..44bb908e1 100644
--- a/src/linux/32/syscallent.h
+++ b/src/linux/32/syscallent.h
@@ -179,7 +179,7 @@
[164] = { 2, 0, SEN(setrlimit), "setrlimit" },
[165] = { 2, 0, SEN(getrusage), "getrusage" },
[166] = { 1, NF, SEN(umask), "umask" },
-[167] = { 5, TC, SEN(prctl), "prctl" },
+[167] = { 5, CC|TC, SEN(prctl), "prctl" },
[168] = { 3, 0, SEN(getcpu), "getcpu" },
/* [169] gettimeofday */
/* [170] settimeofday */
@@ -233,7 +233,7 @@
[218] = { 4, 0, SEN(request_key), "request_key" },
[219] = { 5, 0, SEN(keyctl), "keyctl" },
[220] = { 5, TP, SEN(clone), "clone" },
-[221] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[221] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[222] = { 6, TD|TM|SI, SEN(ARCH_mmap), "mmap2" },
[223] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" },
[224] = { 2, TF, SEN(swapon), "swapon" },
@@ -278,7 +278,7 @@
[278] = { 3, 0, SEN(getrandom), "getrandom" },
[279] = { 2, TD, SEN(memfd_create), "memfd_create" },
[280] = { 3, TD, SEN(bpf), "bpf" },
-[281] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[281] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[283] = { 3, 0, SEN(membarrier), "membarrier" },
[284] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/64/syscallent.h b/src/linux/64/syscallent.h
index 7ddc83a9a..1463d1974 100644
--- a/src/linux/64/syscallent.h
+++ b/src/linux/64/syscallent.h
@@ -172,7 +172,7 @@
[164] = { 2, 0, SEN(setrlimit), "setrlimit" },
[165] = { 2, 0, SEN(getrusage), "getrusage" },
[166] = { 1, NF, SEN(umask), "umask" },
-[167] = { 5, TC, SEN(prctl), "prctl" },
+[167] = { 5, CC|TC, SEN(prctl), "prctl" },
[168] = { 3, 0, SEN(getcpu), "getcpu" },
[169] = { 2, TCL, SEN(gettimeofday), "gettimeofday" },
[170] = { 2, TCL, SEN(settimeofday), "settimeofday" },
@@ -226,7 +226,7 @@
[218] = { 4, 0, SEN(request_key), "request_key" },
[219] = { 5, 0, SEN(keyctl), "keyctl" },
[220] = { 5, TP, SEN(clone), "clone" },
-[221] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[221] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[222] = { 6, TD|TM|SI, SEN(mmap), "mmap" },
[223] = { 4, TD, SEN(fadvise64), "fadvise64" },
[224] = { 2, TF, SEN(swapon), "swapon" },
@@ -271,7 +271,7 @@
[278] = { 3, 0, SEN(getrandom), "getrandom" },
[279] = { 2, TD, SEN(memfd_create), "memfd_create" },
[280] = { 3, TD, SEN(bpf), "bpf" },
-[281] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[281] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[282] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[283] = { 3, 0, SEN(membarrier), "membarrier" },
[284] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/alpha/syscallent.h b/src/linux/alpha/syscallent.h
index f9e971ed3..87cbe59bd 100644
--- a/src/linux/alpha/syscallent.h
+++ b/src/linux/alpha/syscallent.h
@@ -66,7 +66,7 @@
[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /* not implemented */
[ 57] = { 2, TF, SEN(symlink), "symlink" },
[ 58] = { 3, TF, SEN(readlink), "readlink" },
-[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 59] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 60] = { 1, NF, SEN(umask), "umask" },
[ 61] = { 1, TF, SEN(chroot), "chroot" },
[ 62] = { 5, TD|TFST|TSTA, SEN(printargs), "osf_old_fstat" }, /* not implemented */
@@ -292,7 +292,7 @@
[345] = { 5, 0, SEN(printargs), "pciconfig_read" },
[346] = { 5, 0, SEN(printargs), "pciconfig_write" },
[347] = { 5, 0, SEN(query_module), "query_module" }, /* not implemented */
-[348] = { 5, TC, SEN(prctl), "prctl" },
+[348] = { 5, CC|TC, SEN(prctl), "prctl" },
[349] = { 4, TD, SEN(pread), "pread64" },
[350] = { 4, TD, SEN(pwrite), "pwrite64" },
[351] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
@@ -456,7 +456,7 @@
[510] = { 5, TD|TF, SEN(renameat2), "renameat2" },
[511] = { 3, 0, SEN(getrandom), "getrandom" },
[512] = { 2, TD, SEN(memfd_create), "memfd_create" },
-[513] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[513] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[514] = { 3, 0, SEN(seccomp), "seccomp" },
[515] = { 3, TD, SEN(bpf), "bpf" },
[516] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
diff --git a/src/linux/arm/syscallent.h b/src/linux/arm/syscallent.h
index 4fd351305..2086308a2 100644
--- a/src/linux/arm/syscallent.h
+++ b/src/linux/arm/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -394,7 +394,7 @@
[384] = { 3, 0, SEN(getrandom), "getrandom" },
[385] = { 2, TD, SEN(memfd_create), "memfd_create" },
[386] = { 3, TD, SEN(bpf), "bpf" },
-[387] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[387] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[389] = { 3, 0, SEN(membarrier), "membarrier" },
[390] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/avr32/syscallent.h b/src/linux/avr32/syscallent.h
index 5d4624abe..104044e5f 100644
--- a/src/linux/avr32/syscallent.h
+++ b/src/linux/avr32/syscallent.h
@@ -17,7 +17,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -154,7 +154,7 @@
[145] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[146] = { 3, TC, SEN(setresgid), "setresgid" },
[147] = { 3, TC, SEN(getresgid), "getresgid" },
-[148] = { 5, TC, SEN(prctl), "prctl" },
+[148] = { 5, CC|TC, SEN(prctl), "prctl" },
[149] = { 3, TN, SEN(socket), "socket" },
[150] = { 3, TN, SEN(bind), "bind" },
[151] = { 3, TN, SEN(connect), "connect" },
@@ -326,7 +326,7 @@
[317] = { 3, 0, SEN(getrandom), "getrandom" },
[318] = { 2, TD, SEN(memfd_create), "memfd_create" },
[319] = { 3, TD, SEN(bpf), "bpf" },
-[320] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[320] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[321] = { 4, TN, SEN(accept4), "accept4" },
[322] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[323] = { 3, 0, SEN(membarrier), "membarrier" },
diff --git a/src/linux/bfin/syscallent.h b/src/linux/bfin/syscallent.h
index 16287d085..05720b4f9 100644
--- a/src/linux/bfin/syscallent.h
+++ b/src/linux/bfin/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -398,4 +398,4 @@
[389] = { 3, 0, SEN(getrandom), "getrandom" },
[390] = { 2, TD, SEN(memfd_create), "memfd_create" },
[391] = { 3, TD, SEN(bpf), "bpf" },
-[392] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[392] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
diff --git a/src/linux/hppa/syscallent.h b/src/linux/hppa/syscallent.h
index 10bda1d8c..a7dd57ce9 100644
--- a/src/linux/hppa/syscallent.h
+++ b/src/linux/hppa/syscallent.h
@@ -14,7 +14,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -175,7 +175,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid), "setresgid" },
[171] = { 3, TC, SEN(getresgid), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -345,7 +345,7 @@
[339] = { 3, 0, SEN(getrandom), "getrandom" },
[340] = { 2, TD, SEN(memfd_create), "memfd_create" },
[341] = { 3, TD, SEN(bpf), "bpf" },
-[342] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[342] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[343] = { 3, 0, SEN(membarrier), "membarrier" },
[344] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[345] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/i386/syscallent.h b/src/linux/i386/syscallent.h
index 3c4cb9fe4..3553a0575 100644
--- a/src/linux/i386/syscallent.h
+++ b/src/linux/i386/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -364,7 +364,7 @@
[355] = { 3, 0, SEN(getrandom), "getrandom" },
[356] = { 2, TD, SEN(memfd_create), "memfd_create" },
[357] = { 3, TD, SEN(bpf), "bpf" },
-[358] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[358] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[359] = { 3, TN, SEN(socket), "socket" },
[360] = { 4, TN, SEN(socketpair), "socketpair" },
[361] = { 3, TN, SEN(bind), "bind" },
diff --git a/src/linux/ia64/syscallent.h b/src/linux/ia64/syscallent.h
index b002c8341..912e9a2a9 100644
--- a/src/linux/ia64/syscallent.h
+++ b/src/linux/ia64/syscallent.h
@@ -29,7 +29,7 @@
[BASE_NR + 6] = { 2, TD|TF, SEN(creat), "creat" },
[BASE_NR + 7] = { 2, TF, SEN(link), "link" },
[BASE_NR + 8] = { 1, TF, SEN(unlink), "unlink" },
-[BASE_NR + 9] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 9] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[BASE_NR + 10] = { 1, TF, SEN(chdir), "chdir" },
[BASE_NR + 11] = { 1, TD, SEN(fchdir), "fchdir" },
[BASE_NR + 12] = { 2, TF, SEN(utimes), "utimes" },
@@ -166,7 +166,7 @@
[BASE_NR + 143] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"},
[BASE_NR + 144] = { 2, 0, SEN(nanosleep_time64), "nanosleep" },
[BASE_NR + 145] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
-[BASE_NR + 146] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 146] = { 5, CC|TC, SEN(prctl), "prctl" },
[BASE_NR + 147] = { 0, PU|NF, SEN(getpagesize), "old_getpagesize" },
[BASE_NR + 148] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" },
[BASE_NR + 149] = { 5, 0, SEN(printargs), "pciconfig_read" },
@@ -338,7 +338,7 @@
[BASE_NR + 315] = { 3, 0, SEN(getrandom), "getrandom" },
[BASE_NR + 316] = { 2, TD, SEN(memfd_create), "memfd_create" },
[BASE_NR + 317] = { 3, TD, SEN(bpf), "bpf" },
-[BASE_NR + 318] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 318] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[BASE_NR + 319] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[BASE_NR + 320] = { 3, 0, SEN(membarrier), "membarrier" },
[BASE_NR + 321] = { 5, 0, SEN(kcmp), "kcmp" },
diff --git a/src/linux/m68k/syscallent.h b/src/linux/m68k/syscallent.h
index 67f66d719..3abd77b0c 100644
--- a/src/linux/m68k/syscallent.h
+++ b/src/linux/m68k/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -361,7 +361,7 @@
[352] = { 3, 0, SEN(getrandom), "getrandom" },
[353] = { 2, TD, SEN(memfd_create), "memfd_create" },
[354] = { 3, TD, SEN(bpf), "bpf" },
-[355] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[355] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[356] = { 3, TN, SEN(socket), "socket" },
[357] = { 4, TN, SEN(socketpair), "socketpair" },
[358] = { 3, TN, SEN(bind), "bind" },
diff --git a/src/linux/microblaze/syscallent.h b/src/linux/microblaze/syscallent.h
index d3446abdb..15ca048ca 100644
--- a/src/linux/microblaze/syscallent.h
+++ b/src/linux/microblaze/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -394,7 +394,7 @@
[385] = { 3, 0, SEN(getrandom), "getrandom" },
[386] = { 2, TD, SEN(memfd_create), "memfd_create" },
[387] = { 3, TD, SEN(bpf), "bpf" },
-[388] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[388] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[389] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[390] = { 3, 0, SEN(membarrier), "membarrier" },
[391] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/mips/syscallent-n32.h b/src/linux/mips/syscallent-n32.h
index 58db21f81..a3e2f1de3 100644
--- a/src/linux/mips/syscallent-n32.h
+++ b/src/linux/mips/syscallent-n32.h
@@ -65,7 +65,7 @@
[BASE_NR + 54] = { 5, TN, SEN(getsockopt), "getsockopt" },
[BASE_NR + 55] = { 5, TP, SEN(clone), "clone" },
[BASE_NR + 56] = { 0, TP, SEN(fork), "fork" },
-[BASE_NR + 57] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 57] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[BASE_NR + 58] = { 1, TP|SE, SEN(exit), "exit" },
[BASE_NR + 59] = { 4, TP, SEN(wait4), "wait4" },
[BASE_NR + 60] = { 2, TS|TP, SEN(kill), "kill" },
@@ -161,7 +161,7 @@
[BASE_NR + 150] = { 0, 0, SEN(vhangup), "vhangup" },
[BASE_NR + 151] = { 2, TF, SEN(pivotroot), "pivot_root" },
[BASE_NR + 152] = { 1, 0, SEN(sysctl), "_sysctl" },
-[BASE_NR + 153] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 153] = { 5, CC|TC, SEN(prctl), "prctl" },
[BASE_NR + 154] = { 1, TCL, SEN(adjtimex32), "adjtimex" },
[BASE_NR + 155] = { 2, 0, SEN(setrlimit), "setrlimit" },
[BASE_NR + 156] = { 1, TF, SEN(chroot), "chroot" },
@@ -328,7 +328,7 @@
[BASE_NR + 317] = { 3, 0, SEN(getrandom), "getrandom" },
[BASE_NR + 318] = { 2, TD, SEN(memfd_create), "memfd_create" },
[BASE_NR + 319] = { 3, TD, SEN(bpf), "bpf" },
-[BASE_NR + 320] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 320] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[BASE_NR + 321] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[BASE_NR + 322] = { 3, 0, SEN(membarrier), "membarrier" },
[BASE_NR + 323] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/mips/syscallent-n64.h b/src/linux/mips/syscallent-n64.h
index dc45447e7..0eb9a4d57 100644
--- a/src/linux/mips/syscallent-n64.h
+++ b/src/linux/mips/syscallent-n64.h
@@ -65,7 +65,7 @@
[BASE_NR + 54] = { 5, TN, SEN(getsockopt), "getsockopt" },
[BASE_NR + 55] = { 5, TP, SEN(clone), "clone" },
[BASE_NR + 56] = { 0, TP, SEN(fork), "fork" },
-[BASE_NR + 57] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 57] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[BASE_NR + 58] = { 1, TP|SE, SEN(exit), "exit" },
[BASE_NR + 59] = { 4, TP, SEN(wait4), "wait4" },
[BASE_NR + 60] = { 2, TS|TP, SEN(kill), "kill" },
@@ -161,7 +161,7 @@
[BASE_NR + 150] = { 0, 0, SEN(vhangup), "vhangup" },
[BASE_NR + 151] = { 2, TF, SEN(pivotroot), "pivot_root" },
[BASE_NR + 152] = { 1, 0, SEN(sysctl), "_sysctl" },
-[BASE_NR + 153] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 153] = { 5, CC|TC, SEN(prctl), "prctl" },
[BASE_NR + 154] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
[BASE_NR + 155] = { 2, 0, SEN(setrlimit), "setrlimit" },
[BASE_NR + 156] = { 1, TF, SEN(chroot), "chroot" },
@@ -324,7 +324,7 @@
[BASE_NR + 313] = { 3, 0, SEN(getrandom), "getrandom" },
[BASE_NR + 314] = { 2, TD, SEN(memfd_create), "memfd_create" },
[BASE_NR + 315] = { 3, TD, SEN(bpf), "bpf" },
-[BASE_NR + 316] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 316] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[BASE_NR + 317] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[BASE_NR + 318] = { 3, 0, SEN(membarrier), "membarrier" },
[BASE_NR + 319] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/mips/syscallent-o32.h b/src/linux/mips/syscallent-o32.h
index a8e83178e..61eb35dfe 100644
--- a/src/linux/mips/syscallent-o32.h
+++ b/src/linux/mips/syscallent-o32.h
@@ -20,7 +20,7 @@
[BASE_NR + 8] = { 2, TD|TF, SEN(creat), "creat" },
[BASE_NR + 9] = { 2, TF, SEN(link), "link" },
[BASE_NR + 10] = { 1, TF, SEN(unlink), "unlink" },
-[BASE_NR + 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[BASE_NR + 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[BASE_NR + 12] = { 1, TF, SEN(chdir), "chdir" },
[BASE_NR + 13] = { 1, TCL, SEN(time), "time" },
[BASE_NR + 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -201,7 +201,7 @@
[BASE_NR + 189] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[BASE_NR + 190] = { 3, TC, SEN(setresgid), "setresgid" },
[BASE_NR + 191] = { 3, TC, SEN(getresgid), "getresgid" },
-[BASE_NR + 192] = { 5, TC, SEN(prctl), "prctl" },
+[BASE_NR + 192] = { 5, CC|TC, SEN(prctl), "prctl" },
[BASE_NR + 193] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[BASE_NR + 194] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[BASE_NR + 195] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -365,7 +365,7 @@
[BASE_NR + 353] = { 3, 0, SEN(getrandom), "getrandom" },
[BASE_NR + 354] = { 2, TD, SEN(memfd_create), "memfd_create" },
[BASE_NR + 355] = { 3, TD, SEN(bpf), "bpf" },
-[BASE_NR + 356] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[BASE_NR + 356] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[BASE_NR + 357] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[BASE_NR + 358] = { 3, 0, SEN(membarrier), "membarrier" },
[BASE_NR + 359] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/powerpc/syscallent.h b/src/linux/powerpc/syscallent.h
index 98b29e5e8..c8f954be4 100644
--- a/src/linux/powerpc/syscallent.h
+++ b/src/linux/powerpc/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -178,7 +178,7 @@
[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[169] = { 3, TC, SEN(setresgid), "setresgid" },
[170] = { 3, TC, SEN(getresgid), "getresgid" },
-[171] = { 5, TC, SEN(prctl), "prctl" },
+[171] = { 5, CC|TC, SEN(prctl), "prctl" },
[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -369,7 +369,7 @@
[359] = { 3, 0, SEN(getrandom), "getrandom" },
[360] = { 2, TD, SEN(memfd_create), "memfd_create" },
[361] = { 3, TD, SEN(bpf), "bpf" },
-[362] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[362] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[363] = { 0, 0, SEN(printargs), "switch_endian" },
[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[365] = { 3, 0, SEN(membarrier), "membarrier" },
diff --git a/src/linux/powerpc64/syscallent.h b/src/linux/powerpc64/syscallent.h
index a5035cb31..64f4c3ad5 100644
--- a/src/linux/powerpc64/syscallent.h
+++ b/src/linux/powerpc64/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -178,7 +178,7 @@
[168] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[169] = { 3, TC, SEN(setresgid), "setresgid" },
[170] = { 3, TC, SEN(getresgid), "getresgid" },
-[171] = { 5, TC, SEN(prctl), "prctl" },
+[171] = { 5, CC|TC, SEN(prctl), "prctl" },
[172] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -364,7 +364,7 @@
[359] = { 3, 0, SEN(getrandom), "getrandom" },
[360] = { 2, TD, SEN(memfd_create), "memfd_create" },
[361] = { 3, TD, SEN(bpf), "bpf" },
-[362] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[362] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[363] = { 0, 0, SEN(printargs), "switch_endian" },
[364] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[365] = { 3, 0, SEN(membarrier), "membarrier" },
diff --git a/src/linux/s390/syscallent.h b/src/linux/s390/syscallent.h
index 5b83b3d15..a808c7b5b 100644
--- a/src/linux/s390/syscallent.h
+++ b/src/linux/s390/syscallent.h
@@ -20,7 +20,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -181,7 +181,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -363,7 +363,7 @@
[351] = { 3, TD, SEN(bpf), "bpf" },
[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
-[354] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[354] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[356] = { 3, 0, SEN(membarrier), "membarrier" },
[357] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" },
diff --git a/src/linux/s390x/syscallent.h b/src/linux/s390x/syscallent.h
index d64141075..90bf993b7 100644
--- a/src/linux/s390x/syscallent.h
+++ b/src/linux/s390x/syscallent.h
@@ -19,7 +19,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -170,7 +170,7 @@
[168] = { 3, TD, SEN(poll_time64), "poll" },
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170 ... 171] = { },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -347,7 +347,7 @@
[351] = { 3, TD, SEN(bpf), "bpf" },
[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" },
[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" },
-[354] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[354] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[355] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[356] = { 3, 0, SEN(membarrier), "membarrier" },
[357] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" },
diff --git a/src/linux/sh/syscallent.h b/src/linux/sh/syscallent.h
index 64f3d6f1f..c238f0400 100644
--- a/src/linux/sh/syscallent.h
+++ b/src/linux/sh/syscallent.h
@@ -20,7 +20,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -181,7 +181,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -382,7 +382,7 @@
[373] = { 3, 0, SEN(getrandom), "getrandom" },
[374] = { 2, TD, SEN(memfd_create), "memfd_create" },
[375] = { 3, TD, SEN(bpf), "bpf" },
-[376] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[376] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[377] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[378] = { 3, 0, SEN(membarrier), "membarrier" },
[379] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/sh64/syscallent.h b/src/linux/sh64/syscallent.h
index 94e6cea3a..f33504235 100644
--- a/src/linux/sh64/syscallent.h
+++ b/src/linux/sh64/syscallent.h
@@ -18,7 +18,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 1, TCL, SEN(time), "time" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -179,7 +179,7 @@
[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" },
[170] = { 3, TC, SEN(setresgid16), "setresgid" },
[171] = { 3, TC, SEN(getresgid16), "getresgid" },
-[172] = { 5, TC, SEN(prctl), "prctl" },
+[172] = { 5, CC|TC, SEN(prctl), "prctl" },
[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" },
[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" },
[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" },
@@ -391,7 +391,7 @@
[384] = { 3, 0, SEN(getrandom), "getrandom" },
[385] = { 2, TD, SEN(memfd_create), "memfd_create" },
[386] = { 3, TD, SEN(bpf), "bpf" },
-[387] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[387] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[388] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[389] = { 3, 0, SEN(membarrier), "membarrier" },
[390] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/sparc/syscallent.h b/src/linux/sparc/syscallent.h
index e3321f448..051a5b964 100644
--- a/src/linux/sparc/syscallent.h
+++ b/src/linux/sparc/syscallent.h
@@ -64,7 +64,7 @@
[ 56] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" },
[ 57] = { 2, TF, SEN(symlink), "symlink" },
[ 58] = { 3, TF, SEN(readlink), "readlink" },
-[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 59] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 60] = { 1, NF, SEN(umask), "umask" },
[ 61] = { 1, TF, SEN(chroot), "chroot" },
[ 62] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" },
@@ -152,7 +152,7 @@
[144] = { 2, 0, SEN(getrlimit), "getrlimit" },
[145] = { 2, 0, SEN(setrlimit), "setrlimit" },
[146] = { 2, TF, SEN(pivotroot), "pivot_root" },
-[147] = { 5, TC, SEN(prctl), "prctl" },
+[147] = { 5, CC|TC, SEN(prctl), "prctl" },
[148] = { 5, 0, SEN(printargs), "pciconfig_read" },
[149] = { 5, 0, SEN(printargs), "pciconfig_write" },
[150] = { 3, TN, SEN(getsockname), "getsockname" },
@@ -355,7 +355,7 @@
[347] = { 3, 0, SEN(getrandom), "getrandom" },
[348] = { 2, TD, SEN(memfd_create), "memfd_create" },
[349] = { 3, TD, SEN(bpf), "bpf" },
-[350] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[350] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[351] = { 3, 0, SEN(membarrier), "membarrier" },
[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[353] = { 3, TN, SEN(bind), "bind" },
diff --git a/src/linux/sparc64/syscallent.h b/src/linux/sparc64/syscallent.h
index 94471f0c7..246343375 100644
--- a/src/linux/sparc64/syscallent.h
+++ b/src/linux/sparc64/syscallent.h
@@ -16,7 +16,7 @@
[ 8] = { 2, TD|TF, SEN(creat), "creat" },
[ 9] = { 2, TF, SEN(link), "link" },
[ 10] = { 1, TF, SEN(unlink), "unlink" },
-[ 11] = { 2, TF|TP|TSD|SE|SI, SEN(execv), "execv" },
+[ 11] = { 2, CC|TF|TP|TSD|SE|SI, SEN(execv), "execv" },
[ 12] = { 1, TF, SEN(chdir), "chdir" },
[ 13] = { 3, TF, SEN(chown), "chown" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
@@ -150,7 +150,7 @@
[144] = { 2, 0, SEN(getrlimit), "getrlimit" },
[145] = { 2, 0, SEN(setrlimit), "setrlimit" },
[146] = { 2, TF, SEN(pivotroot), "pivot_root" },
-[147] = { 5, TC, SEN(prctl), "prctl" },
+[147] = { 5, CC|TC, SEN(prctl), "prctl" },
[148] = { 5, 0, SEN(printargs), "pciconfig_read" },
[149] = { 5, 0, SEN(printargs), "pciconfig_write" },
[150] = { 3, TN, SEN(getsockname), "getsockname" },
@@ -353,7 +353,7 @@
[347] = { 3, 0, SEN(getrandom), "getrandom" },
[348] = { 2, TD, SEN(memfd_create), "memfd_create" },
[349] = { 3, TD, SEN(bpf), "bpf" },
-[350] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[350] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[351] = { 3, 0, SEN(membarrier), "membarrier" },
[352] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[353] = { 3, TN, SEN(bind), "bind" },
diff --git a/src/linux/x32/syscallent.h b/src/linux/x32/syscallent.h
index 38d70ad29..e821ab1fa 100644
--- a/src/linux/x32/syscallent.h
+++ b/src/linux/x32/syscallent.h
@@ -162,7 +162,7 @@
[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
[155] = { 2, TF, SEN(pivotroot), "pivot_root" },
[156] = { 1, 0, SEN(printargs), "_sysctl#64" },
-[157] = { 5, TC, SEN(prctl), "prctl" },
+[157] = { 5, CC|TC, SEN(prctl), "prctl" },
[158] = { 2, 0, SEN(arch_prctl), "arch_prctl" },
[159] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
[160] = { 2, 0, SEN(setrlimit), "setrlimit" },
@@ -354,7 +354,7 @@
[517] = { 6, CST|TN, SEN(recvfrom), "recvfrom" },
[518] = { 3, CST|TN, SEN(sendmsg), "sendmsg" },
[519] = { 3, CST|TN, SEN(recvmsg), "recvmsg" },
-[520] = { 3, CST|TF|TP|TSD|SE|SI,SEN(execve), "execve" },
+[520] = { 3, CC|CST|TF|TP|TSD|SE|SI,SEN(execve), "execve" },
[521] = { 4, CST, SEN(ptrace), "ptrace" },
[522] = { 2, CST|TS, SEN(rt_sigpending), "rt_sigpending" },
[523] = { 4, CST|TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" },
@@ -379,6 +379,6 @@
[542] = { 5, CST|TN, SEN(getsockopt), "getsockopt" },
[543] = { 2, CST|TM, SEN(io_setup), "io_setup" },
[544] = { 3, CST, SEN(io_submit), "io_submit" },
-[545] = { 5, CST|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[545] = { 5, CST|CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[546] = { 5, TD, SEN(preadv2), "preadv2" },
[547] = { 5, TD, SEN(pwritev2), "pwritev2" },
diff --git a/src/linux/x86_64/syscallent.h b/src/linux/x86_64/syscallent.h
index b6eb3d3d3..9fd1e3f22 100644
--- a/src/linux/x86_64/syscallent.h
+++ b/src/linux/x86_64/syscallent.h
@@ -64,7 +64,7 @@
[ 56] = { 5, TP, SEN(clone), "clone" },
[ 57] = { 0, TP, SEN(fork), "fork" },
[ 58] = { 0, TP, SEN(vfork), "vfork" },
-[ 59] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[ 59] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[ 60] = { 1, TP|SE, SEN(exit), "exit" },
[ 61] = { 4, TP, SEN(wait4), "wait4" },
[ 62] = { 2, TS|TP, SEN(kill), "kill" },
@@ -162,7 +162,7 @@
[154] = { 3, 0, SEN(modify_ldt), "modify_ldt" },
[155] = { 2, TF, SEN(pivotroot), "pivot_root" },
[156] = { 1, 0, SEN(sysctl), "_sysctl" },
-[157] = { 5, TC, SEN(prctl), "prctl" },
+[157] = { 5, CC|TC, SEN(prctl), "prctl" },
[158] = { 2, 0, SEN(arch_prctl), "arch_prctl" },
[159] = { 1, TCL, SEN(adjtimex64), "adjtimex" },
[160] = { 2, 0, SEN(setrlimit), "setrlimit" },
@@ -327,7 +327,7 @@
[319] = { 2, TD, SEN(memfd_create), "memfd_create" },
[320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" },
[321] = { 3, TD, SEN(bpf), "bpf" },
-[322] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[322] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[323] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[324] = { 3, 0, SEN(membarrier), "membarrier" },
[325] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/linux/xtensa/syscallent.h b/src/linux/xtensa/syscallent.h
index eb6425d53..09fed329c 100644
--- a/src/linux/xtensa/syscallent.h
+++ b/src/linux/xtensa/syscallent.h
@@ -117,7 +117,7 @@
[114] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
[115] = { 4, TN, SEN(sendmmsg), "sendmmsg" },
[116] = { 5, TP, SEN(clone), "clone" },
-[117] = { 3, TF|TP|TSD|SE|SI, SEN(execve), "execve" },
+[117] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" },
[118] = { 1, TP|SE, SEN(exit), "exit" },
[119] = { 1, TP|SE, SEN(exit), "exit_group" },
[120] = { 0, PU|NF, SEN(getpid), "getpid" },
@@ -130,7 +130,7 @@
[127] = { 0, PU|NF, SEN(gettid), "gettid" },
[128] = { 0, 0, SEN(setsid), "setsid" },
[129] = { 1, 0, SEN(getsid), "getsid" },
-[130] = { 5, TC, SEN(prctl), "prctl" },
+[130] = { 5, CC|TC, SEN(prctl), "prctl" },
[131] = { 1, NF, SEN(personality), "personality" },
[132] = { 2, 0, SEN(getpriority), "getpriority" },
[133] = { 3, 0, SEN(setpriority), "setpriority" },
@@ -336,7 +336,7 @@
[338] = { 3, 0, SEN(getrandom), "getrandom" },
[339] = { 2, TD, SEN(memfd_create), "memfd_create" },
[340] = { 3, TD, SEN(bpf), "bpf" },
-[341] = { 5, TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
+[341] = { 5, CC|TD|TF|TP|TSD|SE|SI, SEN(execveat), "execveat" },
[342] = { 1, TD, SEN(userfaultfd), "userfaultfd" },
[343] = { 3, 0, SEN(membarrier), "membarrier" },
[344] = { 3, TM, SEN(mlock2), "mlock2" },
diff --git a/src/strace.c b/src/strace.c
index 00a99f3c6..5f7951d94 100644
--- a/src/strace.c
+++ b/src/strace.c
@@ -905,6 +905,40 @@ expand_tcbtab(void)
*tcb_ptr = newtcbs;
}
+/* load the contenst of /proc/$pid/comm into $buf. */
+static void
+load_pid_comm(int pid, char *buf, size_t buf_size)
+{
+ static const char comm_path[] = "/proc/%d/comm";
+ char procfile[sizeof(comm_path) + sizeof(int) * 3];
+
+ if (buf_size == 0)
+ return;
+
+ buf [0] = '\0';
+
+ xsprintf(procfile, comm_path, pid);
+ FILE *fp = fopen_stream(procfile, "r");
+ if (!fp)
+ return;
+
+ if (fgets(buf, buf_size, fp)) {
+ /* Trim the last newline. */
+ char *nl = strrchr(buf, '\n');
+ if (nl)
+ *nl = '\0';
+ }
+ fclose(fp);
+}
+
+void
+maybe_load_task_comm(struct tcb *tcp)
+{
+ if (!(pid_decoding & PID_DECODING_COMM))
+ return;
+ load_pid_comm(get_proc_pid(tcp->pid), tcp->comm, sizeof(tcp->comm));
+}
+
static struct tcb *
alloctcb(int pid)
{
@@ -920,6 +954,7 @@ alloctcb(int pid)
memset(tcp, 0, sizeof(*tcp));
list_init(&tcp->wait_list);
tcp->pid = pid;
+ maybe_load_task_comm(tcp);
#if SUPPORTED_PERSONALITIES > 1
tcp->currpers = current_personality;
#endif
diff --git a/src/syscall.c b/src/syscall.c
index e87b5f9d5..aecec5e68 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -29,6 +29,9 @@
/* for struct iovec */
#include <sys/uio.h>
+/* for PR_SET_NAME */
+#include <linux/prctl.h>
+
/* for __X32_SYSCALL_BIT */
#include "scno.h"
@@ -737,6 +740,11 @@ syscall_exiting_decode(struct tcb *tcp, struct timespec *pts)
if (tcp_sysent(tcp)->sys_flags & MEMORY_MAPPING_CHANGE)
mmap_notify_report(tcp);
+ if ((tcp_sysent(tcp)->sys_flags & COMM_CHANGE)
+ && ((tcp_sysent(tcp)->sen == SEN_prctl && tcp->u_arg[0] == PR_SET_NAME)
+ || tcp_sysent(tcp)->sen != SEN_prctl))
+ maybe_load_task_comm(tcp);
+
if (filtered(tcp))
return 0;
diff --git a/src/sysent.h b/src/sysent.h
index f45a00baf..d9d4b187f 100644
--- a/src/sysent.h
+++ b/src/sysent.h
@@ -39,5 +39,6 @@ typedef struct sysent {
# define TRACE_SECCOMP_DEFAULT 004000000 /* Syscall is traced by seccomp filter by default. */
# define TRACE_CREDS 010000000 /* Trace process credentials-related syscalls. */
# define TRACE_CLOCK 020000000 /* Trace syscalls reading or modifying system clocks. */
+# define COMM_CHANGE 040000000 /* /proc/$pid/comm is updated. */
#endif /* !STRACE_SYSENT_H */
diff --git a/src/sysent_shorthand_defs.h b/src/sysent_shorthand_defs.h
index 5b4d87dbf..4cf65342a 100644
--- a/src/sysent_shorthand_defs.h
+++ b/src/sysent_shorthand_defs.h
@@ -30,6 +30,7 @@
# define TSD 0
# define TC 0
# define TCL 0
+# define CC 0
# define SEN(a) 0, 0
#else /* !STRACE_TESTS_H */
@@ -57,6 +58,7 @@
# define TSD TRACE_SECCOMP_DEFAULT
# define TC TRACE_CREDS
# define TCL TRACE_CLOCK
+# define CC COMM_CHANGE
/* SEN(a) is defined elsewhere */
#endif
diff --git a/src/sysent_shorthand_undefs.h b/src/sysent_shorthand_undefs.h
index fbc74bc90..b5ce3c6b2 100644
--- a/src/sysent_shorthand_undefs.h
+++ b/src/sysent_shorthand_undefs.h
@@ -28,4 +28,5 @@
#undef TSD
#undef TC
#undef TCL
+#undef CC
#undef SEN
--
2.31.1
More information about the Strace-devel
mailing list