You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When reading a capture, scap_read_fdlist() reuses a stack-allocated scap_fdinfo for every record without clearing it, and scap_fd_read_from_disk() never sets info.regularinfo.mount_id, since the savefile format does not store it (the dev field is optional too, and it is left as is when the record is too short). sinsp_threadinfo::add_fd_from_scap() then copies that value into sinsp_fdinfo::m_mount_id, and since 0.26.0 the FD table deduplication compares it in sinsp_fdinfo::content_equals().
Valgrind reports it as conditional jumps depending on uninitialised values at sinsp_fdinfo::content_equals() when replaying a capture with Falco 0.45.0-rc3 (libs 0.26.0), with the origin in scap_read_fdlist().
How to reproduce it
Replay a capture containing file FDs under Valgrind, e.g. valgrind --track-origins=yes falco -r <capture> ... with any rule that matches.
Expected behaviour
Fields missing from the capture are deterministically zero for every record, as the live parser does 👉
Suggested fix: zero the record at each iteration (not once before the loop, since the union keeps the contents of the previous record types) and add a replay test with mixed record types
Found during the Falco 0.45.0 testing, not blocking for it
Describe the bug
When reading a capture,
scap_read_fdlist()reuses a stack-allocatedscap_fdinfofor every record without clearing it, andscap_fd_read_from_disk()never setsinfo.regularinfo.mount_id, since the savefile format does not store it (thedevfield is optional too, and it is left as is when the record is too short).sinsp_threadinfo::add_fd_from_scap()then copies that value intosinsp_fdinfo::m_mount_id, and since0.26.0the FD table deduplication compares it insinsp_fdinfo::content_equals().libs/userspace/libscap/engine/savefile/scap_savefile.c
Lines 1592 to 1617 in 1800b33
libs/userspace/libscap/engine/savefile/scap_savefile.c
Lines 1516 to 1530 in 1800b33
libs/userspace/libsinsp/threadinfo.cpp
Line 310 in 1800b33
libs/userspace/libsinsp/fdinfo.cpp
Lines 48 to 50 in 1800b33
libs/userspace/libsinsp/fdtable.cpp
Line 103 in 1800b33
Valgrind reports it as conditional jumps depending on uninitialised values at
sinsp_fdinfo::content_equals()when replaying a capture with Falco0.45.0-rc3(libs0.26.0), with the origin inscap_read_fdlist().How to reproduce it
Replay a capture containing file FDs under Valgrind, e.g.
valgrind --track-origins=yes falco -r <capture> ...with any rule that matches.Expected behaviour
Fields missing from the capture are deterministically zero for every record, as the live parser does 👉
libs/userspace/libsinsp/parsers.cpp
Line 2022 in 1800b33
Additional context
add_fd_from_scap()predates0.26.0, the comparison is new with the FD deduplication 👉 feat(sinsp): CoW individual fdinfos #30720.45.0testing, not blocking for it/kind bug
/area libscap
/area libsinsp