Skip to content

Commit

Permalink
fix(modern): extract the scap vpid instead of the pid
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
  • Loading branch information
Andreagit97 committed May 10, 2024
1 parent 81068b8 commit 2adc6a0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ int BPF_PROG(socket_x,
if(ret >= 0 && maps__get_socket_file_ops() == NULL)
{
struct task_struct *task = get_current_task();
pid_t tgid = extract__task_xid_nr(task, PIDTYPE_TGID);
/* Please note that in `g_settings.scap_pid` scap will put its virtual pid
* if it is running inside a container. If we want to extract the same information
* in the kernel we need to extract the virtual pid of the task.
*/
pid_t vpid = extract__task_xid_vnr(task, PIDTYPE_TGID);
/* it means that scap is performing the calibration */
if(tgid == maps__get_scap_pid())
{
Expand Down

0 comments on commit 2adc6a0

Please sign in to comment.