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

Remove kernel version check for LSM Resolve flag #3415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ScriptSathi
Copy link
Contributor

This PR is the follow-up to this comment #3143 (comment)

In genericlsm.go we check the kernel version for the use of the Resolve flag. But it is not reliable because vendors may (like rhel) may have kernels with additional patches, but they are detected as lower than the required version.

This condition was not necessary because in any case following code will
return an error since it can not found the required hook. So this commit
remove this check and add a specific case where the error should raise
for LSM hooks only.

Signed-off-by: Tristan d'Audibert <tristan.daudibert@orange.com>
@ScriptSathi ScriptSathi requested a review from a team as a code owner February 18, 2025 09:18
@ScriptSathi ScriptSathi requested a review from olsajiri February 18, 2025 09:18
@@ -123,6 +123,11 @@ func FindBtfFuncParamFromHook(hook string, argIndex int) (*btf.FuncParam, error)
}

if err = spec.TypeByName(hook, &hookFn); err != nil {
if strings.HasPrefix(hook, "bpf_lsm_") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is acceptable to such a check instead of passing a boolean directly to the function. I wanted to keep the function resilient

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.

1 participant