Commit 3b7a794
committed
Reliably detect forks in containers
It's possible to have a process in a PID namespace that nevertheless
has tid == vtid (when the parent and nested PID counters happen to
overlap). In this case, we wrongly take the non-container path
while handling clone events and end up overwriting an unrelated
threadinfo (one that happened to have real pid == new child's vpid).
Fix by explicitly passing a flag meaning "the child process is in
a nested PID namespace" from the driver.1 parent ae93dc9 commit 3b7a794
File tree
4 files changed
+27
-2
lines changed- driver
- bpf
- userspace/libsinsp
4 files changed
+27
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
| 1899 | + | |
| 1900 | + | |
1899 | 1901 | | |
1900 | 1902 | | |
1901 | 1903 | | |
| |||
1907 | 1909 | | |
1908 | 1910 | | |
1909 | 1911 | | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1910 | 1924 | | |
1911 | 1925 | | |
1912 | 1926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
934 | 938 | | |
935 | 939 | | |
936 | 940 | | |
| |||
944 | 948 | | |
945 | 949 | | |
946 | 950 | | |
947 | | - | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
948 | 956 | | |
949 | 957 | | |
950 | 958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
| 987 | + | |
987 | 988 | | |
988 | 989 | | |
989 | 990 | | |
| |||
0 commit comments