-
Notifications
You must be signed in to change notification settings - Fork 481
bug: fix assign vfsmnt correctly #3261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@arthur-zhang please put all this in the commit changelog, also any chance you could add test the issue? thanks |
bpf/process/bpf_process_event.h
Outdated
| data->mnt = parent; | ||
| probe_read(&data->vfsmnt, sizeof(data->vfsmnt), | ||
| _(&mnt->mnt)); | ||
| data->vfsmnt = &parent->mnt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, parent->mnt is not pointer but actual vfsmnt object embedded in mount struct,
so we can just take the address from parent.. but I think you still need to use _() to get CORE involved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, i will fix it
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
olsajiri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add missing changelog and it's good to go, thanks
The current code incorrectly assigns vfsmnt during path resolution, causing duplicate or unexpected path prefixes. This commit ensures correct path resolution across different mount types and environments. Signed-off-by: arthur-zhang <happyzhangya@gmail.com>
Fixes
Description
cwd_read do not assign data->vfsmnt correctly.
reproduce:
and cat a file in my_run dir
in tetragon side, it will get a path :
/home/home/arthur/my_run/a.txt, but it should be/home/arthur/my_run/a.txtand in another production env, i found it will get path more than expected when i cat
/tmp/tetragon. the prefix/scon/containers/01J6HEV7R29R4WXXS1N2CS9ATP/rootfs/should not be obtained.in the old code, mnt is pointer to the old data->mnt, which is not correct.
Changelog