@@ -123,6 +123,7 @@ static int f_sys_getresuid_and_gid_x(struct event_filler_arguments *args);
123123#ifdef CAPTURE_SIGNAL_DELIVERIES
124124static int f_sys_signaldeliver_e (struct event_filler_arguments * args );
125125#endif
126+ static int f_sys_setns_e (struct event_filler_arguments * args );
126127
127128/*
128129 * Note, this is not part of g_event_info because we want to share g_event_info with userland.
@@ -333,6 +334,8 @@ const struct ppm_event_entry g_ppm_events[PPM_EVENT_MAX] = {
333334 [PPME_SYSCALL_GETDENTS_X ] = {f_sys_single_x },
334335 [PPME_SYSCALL_GETDENTS64_E ] = {f_sys_single },
335336 [PPME_SYSCALL_GETDENTS64_X ] = {f_sys_single_x },
337+ [PPME_SYSCALL_SETNS_E ] = {f_sys_setns_e },
338+ [PPME_SYSCALL_SETNS_X ] = {PPM_AUTOFILL , 1 , APT_REG , {{AF_ID_RETVAL } } },
336339};
337340
338341/*
@@ -3177,9 +3180,7 @@ static int f_sched_switch_e(struct event_filler_arguments *args)
31773180 steal = cputime64_to_clock_t (kcpustat_this_cpu -> cpustat [CPUTIME_STEAL ]);
31783181 res = val_to_ring (args , steal , 0 , false);
31793182 if (unlikely (res != PPM_SUCCESS ))
3180- {
31813183 return res ;
3182- }
31833184#endif
31843185
31853186 return add_sentinel (args );
@@ -4303,6 +4304,32 @@ static int f_sys_getresuid_and_gid_x(struct event_filler_arguments *args)
43034304 return add_sentinel (args );
43044305}
43054306
4307+ static int f_sys_setns_e (struct event_filler_arguments * args )
4308+ {
4309+ unsigned long val ;
4310+ int res ;
4311+ u32 flags ;
4312+
4313+ /*
4314+ * parse fd
4315+ */
4316+ syscall_get_arguments (current , args -> regs , 0 , 1 , & val );
4317+ res = val_to_ring (args , val , 0 , true, 0 );
4318+ if (unlikely (res != PPM_SUCCESS ))
4319+ return res ;
4320+
4321+ /*
4322+ * get type, parse as clone flags as it's a subset of it
4323+ */
4324+ syscall_get_arguments (current , args -> regs , 1 , 1 , & val );
4325+ flags = clone_flags_to_scap (val );
4326+ res = val_to_ring (args , flags , 0 , true, 0 );
4327+ if (unlikely (res != PPM_SUCCESS ))
4328+ return res ;
4329+
4330+ return add_sentinel (args );
4331+ }
4332+
43064333#ifdef CAPTURE_SIGNAL_DELIVERIES
43074334static int f_sys_signaldeliver_e (struct event_filler_arguments * args )
43084335{
0 commit comments