Skip to content

Commit

Permalink
fix(sinsp): invalid threads shoudln't be in a pid namespace
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Terzolo <[email protected]>
  • Loading branch information
Andreagit97 authored and poiana committed Jun 20, 2024
1 parent 3c1264c commit 4172892
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion userspace/libsinsp/threadinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ class SINSP_PUBLIC sinsp_threadinfo : public libsinsp::state::table_entry
*/
inline bool is_in_pid_namespace() const
{
return (m_flags & PPM_CL_CHILD_IN_PIDNS || m_tid != m_vtid);
// m_tid should be always valid because we read it from the scap event header
return (m_flags & PPM_CL_CHILD_IN_PIDNS || (m_tid != m_vtid && m_vtid >= 0));
}

/*!
Expand Down

0 comments on commit 4172892

Please sign in to comment.