Skip to content
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

Fix CO:RE support for RHEL 8 and derivatives #896

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

NeonSludge
Copy link
Contributor

This PR fixes CO:RE support in tracee-ebpf on RHEL 8 and its derivatives.
RedHat kernel support was added some time ago by #351 but additional changes are now needed to make that fix work for CO:RE since this mode doesn't use actual RedHat Linux kernel header files and some definitions are missing.

Copy link
Contributor

@rafaeldtinoco rafaeldtinoco left a comment

Choose a reason for hiding this comment

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

LGTM.

$ RHEL_MAJOR=$(grep -Eoh -m 1 '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d '.' -f 1)
$ RHEL_MINOR=$(grep -Eoh -m 1 '[0-9]+\.[0-9]+' /etc/redhat-release | cut -d '.' -f 2)
$ echo $(($RHEL_MAJOR << 8 | $RHEL_MINOR))
2052

@yanivagman I'll give a chance for @yanivagman to review this and merge if he is ok.

@yanivagman
Copy link
Collaborator

LGTM, thanks @NeonSludge!

@yanivagman yanivagman merged commit fb605fe into aquasecurity:main Aug 10, 2021
@itaysk
Copy link
Collaborator

itaysk commented Aug 12, 2021

Shouldn't we've updated automatic compilation in main.go as well?

@yanivagman
Copy link
Collaborator

Not sure I understand correctly what you mean. but this change is only relevant to the CO-RE binary, so I don't think there should be any impact on the compilation steps in main.go

@itaysk
Copy link
Collaborator

itaysk commented Aug 12, 2021

Thanks for the clarification, I didn't understand that before. I still think we should make the compilation methods identical (they were before CORE) to reduce bug potential.

@yanivagman
Copy link
Collaborator

main.go shouldn't build co-re object, as it shouldn't be built on the target (this is the whole point of CO-RE).
I don't see any problem here, and no reason to put this logic in main.go

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.

4 participants