Skip to content

ROX-33217: Instrument inode tracking on directory being created path mkdir#465

Open
JoukoVirtanen wants to merge 5 commits intomainfrom
jv-ROX-33217-instrument-inode-tracking-on-directory-being-created-path_mkdir
Open

ROX-33217: Instrument inode tracking on directory being created path mkdir#465
JoukoVirtanen wants to merge 5 commits intomainfrom
jv-ROX-33217-instrument-inode-tracking-on-directory-being-created-path_mkdir

Conversation

@JoukoVirtanen
Copy link
Copy Markdown
Contributor

@JoukoVirtanen JoukoVirtanen commented Apr 1, 2026

Description

Directory creation events need to be handled correctly. When a directory is created in a tracked directory its inode should be added to a hash set in kernel space. In user space an entry needs to be added into a map with the inode as the key and file path as the value.

An alternative approach can be found at #449

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

CI is sufficient.

@JoukoVirtanen JoukoVirtanen marked this pull request as ready for review April 1, 2026 23:30
@JoukoVirtanen JoukoVirtanen requested a review from a team as a code owner April 1, 2026 23:30
struct inode* parent_inode_ptr = BPF_CORE_READ(parent_dentry, d_inode);
inode_key_t parent_inode = inode_to_key(parent_inode_ptr);

if (should_track_mkdir(parent_inode, path) != PARENT_MONITORED) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had

if (should_track_mkdir(parent_inode, path) == NOT_MONITORED) {

However, test_nonrecursive_wildcard::test_wildcard.py failed with that change. The reason was that was the inodes of all directories created in that test were tracked and subsequently all files in those directories were tracked regardless if they matched the wildcard pattern or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant