ROX-33217: Instrument inode tracking on directory being created path mkdir#465
Open
JoukoVirtanen wants to merge 5 commits intomainfrom
Open
Conversation
JoukoVirtanen
commented
Apr 1, 2026
| 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) { |
Contributor
Author
There was a problem hiding this comment.
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.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Automated testing
If any of these don't apply, please comment below.
Testing Performed
CI is sufficient.