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
Linux 500576e7ccce 6.11.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 01 Nov 2024 03:30:41 +0000 x86_64 GNU/Linux
Additional details
I would fix it myself and submit a PR, but there are multiple ways to do it and I am not sure what's the preferred way.
Right now you check using the CO-RE framework if a new field for kernels between 6.6 and 6.10 is present. If so, read that, otherwise cast the struct into an older mock version and use CO-RE to read the old field.
This doesn't work if we have three different versions now.
There is a way to check for the current linux kernel version by declaring an external variable:
extern int LINUX_KERNEL_VERSION __kconfig;
if (LINUX_KERNEL_VERSION >= KERNEL_VERSION(6, 11, 0)) {
/* we are on v6.11+ */
}
Regenerate vmlinux.h so we have a current struct inode and introduce a struct inode___older_v611 which contains the old fields and use that in the else if branch like you do now in the else branch:
So what's preferred? And if it's solution number 2, how do I regenerate vmlinux.h? On my local machine using bpftool? Do you have another process for that?
I personally would prefer the second case, because it feels better to work with more "current" code and have the special cases present for older kernels.
The text was updated successfully, but these errors were encountered:
Description
Running tracee on a kernel with version >= 6.11 fails with the below error.
Reason for this is that the
ctime
fields in theinode
struct changed again: torvalds/linux@3aa63a5Output of
tracee version
:Output of
uname -a
:Additional details
I would fix it myself and submit a PR, but there are multiple ways to do it and I am not sure what's the preferred way.
Right now you check using the CO-RE framework if a new field for kernels between 6.6 and 6.10 is present. If so, read that, otherwise cast the struct into an older mock version and use CO-RE to read the old field.
This doesn't work if we have three different versions now.
There is a way to check for the current linux kernel version by declaring an external variable:
So, naively, I ended up with code like this:
This doesn't work though, because
vmlinux.h
doesn't contain the new definition ofstruct inode
.Now there are two tways to solve this:
struct inode___newer_v611
which contains the two new fields and use it like the else case:vmlinux.h
so we have a currentstruct inode
and introduce astruct inode___older_v611
which contains the old fields and use that in the else if branch like you do now in the else branch:So what's preferred? And if it's solution number 2, how do I regenerate vmlinux.h? On my local machine using bpftool? Do you have another process for that?
I personally would prefer the second case, because it feels better to work with more "current" code and have the special cases present for older kernels.
The text was updated successfully, but these errors were encountered: