Commit 2a8f13d
committed
process path parsing improvements
- Preprend the chroot of a process to the path:
Even if a process is executed from a chroot (or a different mount
namespace), the kernel reports the path as it were from the host.
For chrooted processes, now we prepend the chroot to the path:
Instead of /usr/bin/curl -> /var/cache/pbuilder/usr/bin/curl
Note: if the process is emulated (with qemu for example), the
checksum will be of the emulator.
- For proceses launched from /proc, like /proc/self/exe or
/proc/<pid>/fd/<number>, we were replacing in the cmdline "/proc/*"
with the absolute path of the binary:
Path: /usr/bin/curl
Cmdline reported: /proc/<pid>/fd/<number> -L 1.1.1.1
Cmdline "fixed": /usr/bin/curl -L 1.1.1.1
Now we only do that for /proc/self/exe, and leave
/proc/<pid>/fd/<number> as is, since Path is already the absolute
path to the binary.
Path: /usr/bin/spotify
Cmdline reported: /proc/self/exe
Cmdline "fixed": /usr/bin/spotify
Path: /usr/bin/curl
Cmdline reported: /proc/<pid>/fd/<number> -L 1.1.1.1
Cmdline final: /proc/<pid>/fd/<number> -L 1.1.1.11 parent fb16dad commit 2a8f13d
2 files changed
+50
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
232 | 254 | | |
233 | 255 | | |
234 | | - | |
| 256 | + | |
235 | 257 | | |
236 | 258 | | |
237 | 259 | | |
| |||
268 | 290 | | |
269 | 291 | | |
270 | 292 | | |
271 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
272 | 296 | | |
273 | 297 | | |
274 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
275 | 308 | | |
276 | 309 | | |
277 | 310 | | |
| |||
306 | 339 | | |
307 | 340 | | |
308 | 341 | | |
| 342 | + | |
| 343 | + | |
309 | 344 | | |
310 | | - | |
| 345 | + | |
311 | 346 | | |
312 | 347 | | |
313 | 348 | | |
| |||
401 | 436 | | |
402 | 437 | | |
403 | 438 | | |
404 | | - | |
| 439 | + | |
| 440 | + | |
405 | 441 | | |
406 | 442 | | |
407 | 443 | | |
408 | 444 | | |
409 | 445 | | |
410 | 446 | | |
411 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
412 | 450 | | |
413 | 451 | | |
414 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
| |||
0 commit comments