-
Notifications
You must be signed in to change notification settings - Fork 376
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
bug: fix assign vfsmnt correctly #3261
base: main
Are you sure you want to change the base?
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
@@ -202,8 +202,7 @@ FUNC_INLINE long cwd_read(struct cwd_read_data *data) | |||
probe_read(&data->dentry, sizeof(data->dentry), | |||
_(&mnt->mnt_mountpoint)); | |||
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
Signed-off-by: arthur-zhang <[email protected]>
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.txt
and 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
Fix vfsmnt assign bug in bpf/process/bpf_process_event.h
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.txt
and 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.