[PATCH] Implement a %credentials trace class

Andrey Zax andrey.zax at gmail.com
Sun Dec 15 18:08:03 UTC 2019


This patch implements a new trace class (%credentials) to trace syscals
related to process credentials.

Initialy implement this for x86 and the generic 32 & 64 bit archs

* basic_filters.c (lookup_class): add %credentials member to syscall_class[]
* sysent.h: define new TRACE_CREDS flag
* sysent_shorthand_defs.h: define CD alias for TRACE_CREDS
* linux/{32,64,i386,x32,x86_64}/syscallent.h: add CD flag to process credentials syscall entries

Signed-off-by: Andrey Zax <andrey.zax at gmail.com>
---
 basic_filters.c           |  1 +
 linux/32/syscallent.h     | 36 ++++++++++-----------
 linux/64/syscallent.h     | 36 ++++++++++-----------
 linux/i386/syscallent.h   | 68 +++++++++++++++++++--------------------
 linux/x32/syscallent.h    | 38 +++++++++++-----------
 linux/x86_64/syscallent.h | 36 ++++++++++-----------
 sysent.h                  | 43 +++++++++++++------------
 sysent_shorthand_defs.h   |  2 ++
 8 files changed, 132 insertions(+), 128 deletions(-)

diff --git a/basic_filters.c b/basic_filters.c
index 5f691eae..d174fb48 100644
--- a/basic_filters.c
+++ b/basic_filters.c
@@ -152,6 +152,7 @@ lookup_class(const char *s)
 		{ "%file",	TRACE_FILE	},
 		{ "%memory",	TRACE_MEMORY	},
 		{ "%process",	TRACE_PROCESS	},
+		{ "%credentials", TRACE_CREDS },
 		{ "%signal",	TRACE_SIGNAL	},
 		{ "%ipc",	TRACE_IPC	},
 		{ "%net",	TRACE_NETWORK	},
diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
index ce3f3e94..01823cde 100644
--- a/linux/32/syscallent.h
+++ b/linux/32/syscallent.h
@@ -102,8 +102,8 @@
 [ 87] = { 2,	TD,		SEN(timerfd_gettime32),		"timerfd_gettime"	},
 [ 88] = { 4,	TD|TF,		SEN(utimensat_time32),		"utimensat"		},
 [ 89] = { 1,	TF,		SEN(acct),			"acct"			},
-[ 90] = { 2,	0,		SEN(capget),			"capget"		},
-[ 91] = { 2,	0,		SEN(capset),			"capset"		},
+[ 90] = { 2,	CD,		SEN(capget),			"capget"		},
+[ 91] = { 2,	CD,		SEN(capset),			"capset"		},
 [ 92] = { 1,	NF,		SEN(personality),		"personality"		},
 [ 93] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [ 94] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
@@ -155,23 +155,23 @@
 [140] = { 3,	0,		SEN(setpriority),		"setpriority"		},
 [141] = { 2,	0,		SEN(getpriority),		"getpriority"		},
 [142] = { 4,	0,		SEN(reboot),			"reboot"		},
-[143] = { 2,	0,		SEN(setregid),			"setregid"		},
-[144] = { 1,	0,		SEN(setgid),			"setgid"		},
-[145] = { 2,	0,		SEN(setreuid),			"setreuid"		},
-[146] = { 1,	0,		SEN(setuid),			"setuid"		},
-[147] = { 3,	0,		SEN(setresuid),			"setresuid"		},
-[148] = { 3,	0,		SEN(getresuid),			"getresuid"		},
-[149] = { 3,	0,		SEN(setresgid),			"setresgid"		},
-[150] = { 3,	0,		SEN(getresgid),			"getresgid"		},
-[151] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
-[152] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
+[143] = { 2,	CD,		SEN(setregid),			"setregid"		},
+[144] = { 1,	CD,		SEN(setgid),			"setgid"		},
+[145] = { 2,	CD,		SEN(setreuid),			"setreuid"		},
+[146] = { 1,	CD,		SEN(setuid),			"setuid"		},
+[147] = { 3,	CD,		SEN(setresuid),			"setresuid"		},
+[148] = { 3,	CD,		SEN(getresuid),			"getresuid"		},
+[149] = { 3,	CD,		SEN(setresgid),			"setresgid"		},
+[150] = { 3,	CD,		SEN(getresgid),			"getresgid"		},
+[151] = { 1,	NF|CD,		SEN(setfsuid),			"setfsuid"		},
+[152] = { 1,	NF|CD,		SEN(setfsgid),			"setfsgid"		},
 [153] = { 1,	0,		SEN(times),			"times"			},
 [154] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [155] = { 1,	0,		SEN(getpgid),			"getpgid"		},
 [156] = { 1,	0,		SEN(getsid),			"getsid"		},
 [157] = { 0,	0,		SEN(setsid),			"setsid"		},
-[158] = { 2,	0,		SEN(getgroups),			"getgroups"		},
-[159] = { 2,	0,		SEN(setgroups),			"setgroups"		},
+[158] = { 2,	CD,		SEN(getgroups),			"getgroups"		},
+[159] = { 2,	CD,		SEN(setgroups),			"setgroups"		},
 [160] = { 1,	0,		SEN(uname),			"uname"			},
 [161] = { 2,	0,		SEN(sethostname),		"sethostname"		},
 [162] = { 2,	0,		SEN(setdomainname),		"setdomainname"		},
@@ -186,10 +186,10 @@
 [171] = { 1,	0,		SEN(adjtimex32),		"adjtimex"		},
 [172] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [173] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
-[174] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
-[175] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
-[176] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
-[177] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[174] = { 0,	PU|NF|CD,		SEN(getuid),			"getuid"		},
+[175] = { 0,	PU|NF|CD,		SEN(geteuid),			"geteuid"		},
+[176] = { 0,	PU|NF|CD,		SEN(getgid),			"getgid"		},
+[177] = { 0,	PU|NF|CD,		SEN(getegid),			"getegid"		},
 [178] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [180] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h
index 5e5fea45..da2cb375 100644
--- a/linux/64/syscallent.h
+++ b/linux/64/syscallent.h
@@ -95,8 +95,8 @@
 [ 87] = { 2,	TD,		SEN(timerfd_gettime64),		"timerfd_gettime"	},
 [ 88] = { 4,	TD|TF,		SEN(utimensat_time64),		"utimensat"		},
 [ 89] = { 1,	TF,		SEN(acct),			"acct"			},
-[ 90] = { 2,	0,		SEN(capget),			"capget"		},
-[ 91] = { 2,	0,		SEN(capset),			"capset"		},
+[ 90] = { 2,	CD,		SEN(capget),			"capget"		},
+[ 91] = { 2,	CD,		SEN(capset),			"capset"		},
 [ 92] = { 1,	NF,		SEN(personality),		"personality"		},
 [ 93] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [ 94] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
@@ -148,23 +148,23 @@
 [140] = { 3,	0,		SEN(setpriority),		"setpriority"		},
 [141] = { 2,	0,		SEN(getpriority),		"getpriority"		},
 [142] = { 4,	0,		SEN(reboot),			"reboot"		},
-[143] = { 2,	0,		SEN(setregid),			"setregid"		},
-[144] = { 1,	0,		SEN(setgid),			"setgid"		},
-[145] = { 2,	0,		SEN(setreuid),			"setreuid"		},
-[146] = { 1,	0,		SEN(setuid),			"setuid"		},
-[147] = { 3,	0,		SEN(setresuid),			"setresuid"		},
-[148] = { 3,	0,		SEN(getresuid),			"getresuid"		},
-[149] = { 3,	0,		SEN(setresgid),			"setresgid"		},
-[150] = { 3,	0,		SEN(getresgid),			"getresgid"		},
-[151] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
-[152] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
+[143] = { 2,	CD,		SEN(setregid),			"setregid"		},
+[144] = { 1,	CD,		SEN(setgid),			"setgid"		},
+[145] = { 2,	CD,		SEN(setreuid),			"setreuid"		},
+[146] = { 1,	CD,		SEN(setuid),			"setuid"		},
+[147] = { 3,	CD,		SEN(setresuid),			"setresuid"		},
+[148] = { 3,	CD,		SEN(getresuid),			"getresuid"		},
+[149] = { 3,	CD,		SEN(setresgid),			"setresgid"		},
+[150] = { 3,	CD,		SEN(getresgid),			"getresgid"		},
+[151] = { 1,	NF|CD,		SEN(setfsuid),			"setfsuid"		},
+[152] = { 1,	NF|CD,		SEN(setfsgid),			"setfsgid"		},
 [153] = { 1,	0,		SEN(times),			"times"			},
 [154] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [155] = { 1,	0,		SEN(getpgid),			"getpgid"		},
 [156] = { 1,	0,		SEN(getsid),			"getsid"		},
 [157] = { 0,	0,		SEN(setsid),			"setsid"		},
-[158] = { 2,	0,		SEN(getgroups),			"getgroups"		},
-[159] = { 2,	0,		SEN(setgroups),			"setgroups"		},
+[158] = { 2,	CD,		SEN(getgroups),			"getgroups"		},
+[159] = { 2,	CD,		SEN(setgroups),			"setgroups"		},
 [160] = { 1,	0,		SEN(uname),			"uname"			},
 [161] = { 2,	0,		SEN(sethostname),		"sethostname"		},
 [162] = { 2,	0,		SEN(setdomainname),		"setdomainname"		},
@@ -179,10 +179,10 @@
 [171] = { 1,	0,		SEN(adjtimex64),		"adjtimex"		},
 [172] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [173] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
-[174] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
-[175] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
-[176] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
-[177] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[174] = { 0,	PU|NF|CD,		SEN(getuid),			"getuid"		},
+[175] = { 0,	PU|NF|CD,		SEN(geteuid),			"geteuid"		},
+[176] = { 0,	PU|NF|CD,		SEN(getgid),			"getgid"		},
+[177] = { 0,	PU|NF|CD,		SEN(getegid),			"getegid"		},
 [178] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [180] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
index e2a62985..03e7761c 100644
--- a/linux/i386/syscallent.h
+++ b/linux/i386/syscallent.h
@@ -30,8 +30,8 @@
 [ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
-[ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
+[ 23] = { 1,	CD,		SEN(setuid16),			"setuid"		},
+[ 24] = { 0,	PU|NF|CD,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -53,11 +53,11 @@
 [ 43] = { 1,	0,		SEN(times),			"times"			},
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
-[ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
+[ 46] = { 1,	CD,		SEN(setgid16),			"setgid"		},
+[ 47] = { 0,	PU|NF|CD,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF|CD,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF|CD,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -77,8 +77,8 @@
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
 [ 69] = { 1,	TS,		SEN(ssetmask),			"ssetmask"		},
-[ 70] = { 2,	0,		SEN(setreuid16),		"setreuid"		},
-[ 71] = { 2,	0,		SEN(setregid16),		"setregid"		},
+[ 70] = { 2,	CD,		SEN(setreuid16),		"setreuid"		},
+[ 71] = { 2,	CD,		SEN(setregid16),		"setregid"		},
 [ 72] = { 3,	TS,		SEN(sigsuspend),		"sigsuspend"		},
 [ 73] = { 1,	TS,		SEN(sigpending),		"sigpending"		},
 [ 74] = { 2,	0,		SEN(sethostname),		"sethostname"		},
@@ -87,8 +87,8 @@
 [ 77] = { 2,	0,		SEN(getrusage),			"getrusage"		},
 [ 78] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [ 79] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
-[ 80] = { 2,	0,		SEN(getgroups16),		"getgroups"		},
-[ 81] = { 2,	0,		SEN(setgroups16),		"setgroups"		},
+[ 80] = { 2,	CD,		SEN(getgroups16),		"getgroups"		},
+[ 81] = { 2,	CD,		SEN(setgroups16),		"setgroups"		},
 [ 82] = { 1,	TD,		SEN(oldselect),			"select"		},
 [ 83] = { 2,	TF,		SEN(symlink),			"symlink"		},
 [ 84] = { 2,	TF|TLST|TSTA,	SEN(oldlstat),			"oldlstat"		},
@@ -145,8 +145,8 @@
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
 [136] = { 1,	NF,		SEN(personality),		"personality"		},
 [137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
-[138] = { 1,	NF,		SEN(setfsuid16),		"setfsuid"		},
-[139] = { 1,	NF,		SEN(setfsgid16),		"setfsgid"		},
+[138] = { 1,	NF|CD,		SEN(setfsuid16),		"setfsuid"		},
+[139] = { 1,	NF|CD,		SEN(setfsgid16),		"setfsgid"		},
 [140] = { 5,	TD,		SEN(llseek),			"_llseek"		},
 [141] = { 3,	TD,		SEN(getdents),			"getdents"		},
 [142] = { 5,	TD,		SEN(select),			"_newselect"		},
@@ -171,14 +171,14 @@
 [161] = { 2,	0,		SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"},
 [162] = { 2,	0,		SEN(nanosleep_time32),		"nanosleep"		},
 [163] = { 5,	TM|SI,		SEN(mremap),			"mremap"		},
-[164] = { 3,	0,		SEN(setresuid16),		"setresuid"		},
-[165] = { 3,	0,		SEN(getresuid16),		"getresuid"		},
+[164] = { 3,	CD,		SEN(setresuid16),		"setresuid"		},
+[165] = { 3,	CD,		SEN(getresuid16),		"getresuid"		},
 [166] = { 5,	0,		SEN(vm86),			"vm86"			},
 [167] = { 5,	0,		SEN(query_module),		"query_module"		},
 [168] = { 3,	TD,		SEN(poll_time32),		"poll"			},
 [169] = { 3,	0,		SEN(nfsservctl),		"nfsservctl"		},
-[170] = { 3,	0,		SEN(setresgid16),		"setresgid"		},
-[171] = { 3,	0,		SEN(getresgid16),		"getresgid"		},
+[170] = { 3,	CD,		SEN(setresgid16),		"setresgid"		},
+[171] = { 3,	CD,		SEN(getresgid16),		"getresgid"		},
 [172] = { 5,	0,		SEN(prctl),			"prctl"			},
 [173] = { 0,	TS,		SEN(rt_sigreturn),		"rt_sigreturn"		},
 [174] = { 4,	TS,		SEN(rt_sigaction),		"rt_sigaction"		},
@@ -191,8 +191,8 @@
 [181] = { 5,	TD,		SEN(pwrite),			"pwrite64"		},
 [182] = { 3,	TF,		SEN(chown16),			"chown"			},
 [183] = { 2,	TF,		SEN(getcwd),			"getcwd"		},
-[184] = { 2,	0,		SEN(capget),			"capget"		},
-[185] = { 2,	0,		SEN(capset),			"capset"		},
+[184] = { 2,	CD,		SEN(capget),			"capget"		},
+[185] = { 2,	CD,		SEN(capset),			"capset"		},
 [186] = { 2,	TS,		SEN(sigaltstack),		"sigaltstack"		},
 [187] = { 4,	TD|TN,		SEN(sendfile),			"sendfile"		},
 [188] = { 5,	TN,		SEN(getpmsg),			"getpmsg"		},
@@ -206,24 +206,24 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
-[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	PU|NF,		SEN(getegid),			"getegid32"		},
-[203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
-[204] = { 2,	0,		SEN(setregid),			"setregid32"		},
-[205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
-[206] = { 2,	0,		SEN(setgroups),			"setgroups32"		},
+[199] = { 0,	PU|NF|CD,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF|CD,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF|CD,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF|CD,		SEN(getegid),			"getegid32"		},
+[203] = { 2,	CD,		SEN(setreuid),			"setreuid32"		},
+[204] = { 2,	CD,		SEN(setregid),			"setregid32"		},
+[205] = { 2,	CD,		SEN(getgroups),			"getgroups32"		},
+[206] = { 2,	CD,		SEN(setgroups),			"setgroups32"		},
 [207] = { 3,	TD,		SEN(fchown),			"fchown32"		},
-[208] = { 3,	0,		SEN(setresuid),			"setresuid32"		},
-[209] = { 3,	0,		SEN(getresuid),			"getresuid32"		},
-[210] = { 3,	0,		SEN(setresgid),			"setresgid32"		},
-[211] = { 3,	0,		SEN(getresgid),			"getresgid32"		},
+[208] = { 3,	CD,		SEN(setresuid),			"setresuid32"		},
+[209] = { 3,	CD,		SEN(getresuid),			"getresuid32"		},
+[210] = { 3,	CD,		SEN(setresgid),			"setresgid32"		},
+[211] = { 3,	CD,		SEN(getresgid),			"getresgid32"		},
 [212] = { 3,	TF,		SEN(chown),			"chown32"		},
-[213] = { 1,	0,		SEN(setuid),			"setuid32"		},
-[214] = { 1,	0,		SEN(setgid),			"setgid32"		},
-[215] = { 1,	NF,		SEN(setfsuid),			"setfsuid32"		},
-[216] = { 1,	NF,		SEN(setfsgid),			"setfsgid32"		},
+[213] = { 1,	CD,		SEN(setuid),			"setuid32"		},
+[214] = { 1,	CD,		SEN(setgid),			"setgid32"		},
+[215] = { 1,	NF|CD,		SEN(setfsuid),			"setfsuid32"		},
+[216] = { 1,	NF|CD,		SEN(setfsgid),			"setfsgid32"		},
 [217] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
 [218] = { 3,	TM,		SEN(mincore),			"mincore"		},
 [219] = { 3,	TM,		SEN(madvise),			"madvise"		},
diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h
index 07058f98..cdf4c663 100644
--- a/linux/x32/syscallent.h
+++ b/linux/x32/syscallent.h
@@ -107,31 +107,31 @@
 [ 99] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [100] = { 1,	0,		SEN(times),			"times"			},
 [101] = { 4,	0,		SEN(printargs),			"ptrace#64"		},
-[102] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
+[102] = { 0,	PU|NF|CD,		SEN(getuid),			"getuid"		},
 [103] = { 3,	0,		SEN(syslog),			"syslog"		},
-[104] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
-[105] = { 1,	0,		SEN(setuid),			"setuid"		},
-[106] = { 1,	0,		SEN(setgid),			"setgid"		},
-[107] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
-[108] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[104] = { 0,	PU|NF|CD,		SEN(getgid),			"getgid"		},
+[105] = { 1,	CD,		SEN(setuid),			"setuid"		},
+[106] = { 1,	CD,		SEN(setgid),			"setgid"		},
+[107] = { 0,	PU|NF|CD,		SEN(geteuid),			"geteuid"		},
+[108] = { 0,	PU|NF|CD,		SEN(getegid),			"getegid"		},
 [109] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [110] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
 [111] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
-[112] = { 0,	0,		SEN(setsid),			"setsid"		},
-[113] = { 2,	0,		SEN(setreuid),			"setreuid"		},
-[114] = { 2,	0,		SEN(setregid),			"setregid"		},
-[115] = { 2,	0,		SEN(getgroups),			"getgroups"		},
-[116] = { 2,	0,		SEN(setgroups),			"setgroups"		},
-[117] = { 3,	0,		SEN(setresuid),			"setresuid"		},
-[118] = { 3,	0,		SEN(getresuid),			"getresuid"		},
-[119] = { 3,	0,		SEN(setresgid),			"setresgid"		},
-[120] = { 3,	0,		SEN(getresgid),			"getresgid"		},
+[112] = { 0,	CD,		SEN(setsid),			"setsid"		},
+[113] = { 2,	CD,		SEN(setreuid),			"setreuid"		},
+[114] = { 2,	CD,		SEN(setregid),			"setregid"		},
+[115] = { 2,	CD,		SEN(getgroups),			"getgroups"		},
+[116] = { 2,	CD,		SEN(setgroups),			"setgroups"		},
+[117] = { 3,	CD,		SEN(setresuid),			"setresuid"		},
+[118] = { 3,	CD,		SEN(getresuid),			"getresuid"		},
+[119] = { 3,	CD,		SEN(setresgid),			"setresgid"		},
+[120] = { 3,	CD,		SEN(getresgid),			"getresgid"		},
 [121] = { 1,	0,		SEN(getpgid),			"getpgid"		},
-[122] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
-[123] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
+[122] = { 1,	NF|CD,		SEN(setfsuid),			"setfsuid"		},
+[123] = { 1,	NF|CD,		SEN(setfsgid),			"setfsgid"		},
 [124] = { 1,	0,		SEN(getsid),			"getsid"		},
-[125] = { 2,	0,		SEN(capget),			"capget"		},
-[126] = { 2,	0,		SEN(capset),			"capset"		},
+[125] = { 2,	CD,		SEN(capget),			"capget"		},
+[126] = { 2,	CD,		SEN(capset),			"capset"		},
 [127] = { 2,	TS,		SEN(printargs),			"rt_sigpending#64"	},
 [128] = { 4,	TS,		SEN(printargs),			"rt_sigtimedwait#64"	},
 [129] = { 3,	TS,		SEN(printargs),			"rt_sigqueueinfo#64"	},
diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h
index ae9fc5eb..c4f1122d 100644
--- a/linux/x86_64/syscallent.h
+++ b/linux/x86_64/syscallent.h
@@ -107,31 +107,31 @@
 [ 99] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [100] = { 1,	0,		SEN(times),			"times"			},
 [101] = { 4,	0,		SEN(ptrace),			"ptrace"		},
-[102] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
+[102] = { 0,	PU|NF|CD,		SEN(getuid),			"getuid"		},
 [103] = { 3,	0,		SEN(syslog),			"syslog"		},
-[104] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
-[105] = { 1,	0,		SEN(setuid),			"setuid"		},
-[106] = { 1,	0,		SEN(setgid),			"setgid"		},
-[107] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
-[108] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[104] = { 0,	PU|NF|CD,		SEN(getgid),			"getgid"		},
+[105] = { 1,	CD,		SEN(setuid),			"setuid"		},
+[106] = { 1,	CD,		SEN(setgid),			"setgid"		},
+[107] = { 0,	PU|NF|CD,		SEN(geteuid),			"geteuid"		},
+[108] = { 0,	PU|NF|CD,		SEN(getegid),			"getegid"		},
 [109] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [110] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
 [111] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [112] = { 0,	0,		SEN(setsid),			"setsid"		},
-[113] = { 2,	0,		SEN(setreuid),			"setreuid"		},
-[114] = { 2,	0,		SEN(setregid),			"setregid"		},
-[115] = { 2,	0,		SEN(getgroups),			"getgroups"		},
-[116] = { 2,	0,		SEN(setgroups),			"setgroups"		},
-[117] = { 3,	0,		SEN(setresuid),			"setresuid"		},
-[118] = { 3,	0,		SEN(getresuid),			"getresuid"		},
-[119] = { 3,	0,		SEN(setresgid),			"setresgid"		},
-[120] = { 3,	0,		SEN(getresgid),			"getresgid"		},
+[113] = { 2,	CD,		SEN(setreuid),			"setreuid"		},
+[114] = { 2,	CD,		SEN(setregid),			"setregid"		},
+[115] = { 2,	CD,		SEN(getgroups),			"getgroups"		},
+[116] = { 2,	CD,		SEN(setgroups),			"setgroups"		},
+[117] = { 3,	CD,		SEN(setresuid),			"setresuid"		},
+[118] = { 3,	CD,		SEN(getresuid),			"getresuid"		},
+[119] = { 3,	CD,		SEN(setresgid),			"setresgid"		},
+[120] = { 3,	CD,		SEN(getresgid),			"getresgid"		},
 [121] = { 1,	0,		SEN(getpgid),			"getpgid"		},
-[122] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
-[123] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
+[122] = { 1,	NF|CD,		SEN(setfsuid),			"setfsuid"		},
+[123] = { 1,	NF|CD,		SEN(setfsgid),			"setfsgid"		},
 [124] = { 1,	0,		SEN(getsid),			"getsid"		},
-[125] = { 2,	0,		SEN(capget),			"capget"		},
-[126] = { 2,	0,		SEN(capset),			"capset"		},
+[125] = { 2,	CD,		SEN(capget),			"capget"		},
+[126] = { 2,	CD,		SEN(capset),			"capset"		},
 [127] = { 2,	TS,		SEN(rt_sigpending),		"rt_sigpending"		},
 [128] = { 4,	TS,		SEN(rt_sigtimedwait_time64),	"rt_sigtimedwait"	},
 [129] = { 3,	TS,		SEN(rt_sigqueueinfo),		"rt_sigqueueinfo"	},
diff --git a/sysent.h b/sysent.h
index 02c9b198..da88e164 100644
--- a/sysent.h
+++ b/sysent.h
@@ -16,26 +16,27 @@ typedef struct sysent {
 	const char *sys_name;
 } struct_sysent;
 
-# define TRACE_FILE			00000001	/* Trace file-related syscalls. */
-# define TRACE_IPC			00000002	/* Trace IPC-related syscalls. */
-# define TRACE_NETWORK			00000004	/* Trace network-related syscalls. */
-# define TRACE_PROCESS			00000010	/* Trace process-related syscalls. */
-# define TRACE_SIGNAL			00000020	/* Trace signal-related syscalls. */
-# define TRACE_DESC			00000040	/* Trace file descriptor-related syscalls. */
-# define TRACE_MEMORY			00000100	/* Trace memory mapping-related syscalls. */
-# define SYSCALL_NEVER_FAILS		00000200	/* Syscall is always successful. */
-# define MEMORY_MAPPING_CHANGE		00000400	/* Trigger proc/maps cache updating */
-# define STACKTRACE_CAPTURE_ON_ENTER	00001000	/* Capture stacktrace on "entering" stage */
-# define TRACE_INDIRECT_SUBCALL		00002000	/* Syscall is an indirect socket/ipc subcall. */
-# define COMPAT_SYSCALL_TYPES		00004000	/* A compat syscall that uses compat types. */
-# define TRACE_STAT			00010000	/* Trace {,*_}{,old}{,x}stat{,64} syscalls. */
-# define TRACE_LSTAT			00020000	/* Trace *lstat* syscalls. */
-# define TRACE_STATFS			00040000	/* Trace statfs, statfs64, and statvfs syscalls. */
-# define TRACE_FSTATFS			00100000	/* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */
-# define TRACE_STATFS_LIKE		00200000	/* Trace statfs-like, fstatfs-like and ustat syscalls. */
-# define TRACE_FSTAT			00400000	/* Trace *fstat{,at}{,64} syscalls. */
-# define TRACE_STAT_LIKE		01000000	/* Trace *{,l,f}stat{,x,at}{,64} syscalls. */
-# define TRACE_PURE			02000000	/* Trace getter syscalls with no arguments. */
-# define TRACE_SECCOMP_DEFAULT		04000000	/* Syscall is traced by seccomp filter by default. */
+# define TRACE_FILE			000000001	/* Trace file-related syscalls. */
+# define TRACE_IPC			000000002	/* Trace IPC-related syscalls. */
+# define TRACE_NETWORK			000000004	/* Trace network-related syscalls. */
+# define TRACE_PROCESS			000000010	/* Trace process-related syscalls. */
+# define TRACE_SIGNAL			000000020	/* Trace signal-related syscalls. */
+# define TRACE_DESC			000000040	/* Trace file descriptor-related syscalls. */
+# define TRACE_MEMORY			000000100	/* Trace memory mapping-related syscalls. */
+# define SYSCALL_NEVER_FAILS		000000200	/* Syscall is always successful. */
+# define MEMORY_MAPPING_CHANGE		000000400	/* Trigger proc/maps cache updating */
+# define STACKTRACE_CAPTURE_ON_ENTER	000001000	/* Capture stacktrace on "entering" stage */
+# define TRACE_INDIRECT_SUBCALL		000002000	/* Syscall is an indirect socket/ipc subcall. */
+# define COMPAT_SYSCALL_TYPES		000004000	/* A compat syscall that uses compat types. */
+# define TRACE_STAT			000010000	/* Trace {,*_}{,old}{,x}stat{,64} syscalls. */
+# define TRACE_LSTAT			000020000	/* Trace *lstat* syscalls. */
+# define TRACE_STATFS			000040000	/* Trace statfs, statfs64, and statvfs syscalls. */
+# define TRACE_FSTATFS			000100000	/* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */
+# define TRACE_STATFS_LIKE		000200000	/* Trace statfs-like, fstatfs-like and ustat syscalls. */
+# define TRACE_FSTAT			000400000	/* Trace *fstat{,at}{,64} syscalls. */
+# define TRACE_STAT_LIKE		001000000	/* Trace *{,l,f}stat{,x,at}{,64} syscalls. */
+# define TRACE_PURE			002000000	/* Trace getter syscalls with no arguments. */
+# define TRACE_SECCOMP_DEFAULT		004000000	/* Syscall is traced by seccomp filter by default. */
+# define TRACE_CREDS       010000000 /* Trace process credentials-related syscalls */
 
 #endif /* !STRACE_SYSENT_H */
diff --git a/sysent_shorthand_defs.h b/sysent_shorthand_defs.h
index 55280848..3ce6090c 100644
--- a/sysent_shorthand_defs.h
+++ b/sysent_shorthand_defs.h
@@ -28,6 +28,7 @@
 # define SE	0
 # define CST	0
 # define TSD	0
+# define CD    0
 # define SEN(a)	0, 0
 
 #else	/*	!STRACE_TESTS_H	*/
@@ -53,6 +54,7 @@
 # define SE	STACKTRACE_CAPTURE_ON_ENTER
 # define CST	COMPAT_SYSCALL_TYPES
 # define TSD	TRACE_SECCOMP_DEFAULT
+# define CD  TRACE_CREDS
 /* SEN(a) is defined elsewhere */
 
 #endif
-- 
2.24.0



More information about the Strace-devel mailing list