-
Notifications
You must be signed in to change notification settings - Fork 393
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove kernel version check for LSM Resolve flag
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 <[email protected]>
- Loading branch information
1 parent
9f60b23
commit 886cad3
Showing
2 changed files
with
5 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,12 +243,6 @@ func addLsm(f *v1alpha1.LsmHookSpec, in *addLsmIn) (id idtable.EntryID, err erro | |
if !bpf.HasProgramLargeSize() { | ||
return errFn(fmt.Errorf("Error: Resolve flag can't be used for your kernel version. Please update to version 5.4 or higher or disable Resolve flag")) | ||
} | ||
if !kernels.MinKernelVersion("5.7.0") { | ||
// bpf_lsm_<hook_name> does not exist in BTF file before 5.7 | ||
// https://lore.kernel.org/bpf/[email protected]/ | ||
return errFn(fmt.Errorf("Error: LSM programs can not use Resolve flag for your kernel version." + | ||
"Please use Kprobe instead or update your kernel to version 5.7 or higher")) | ||
} | ||
lastBtfType, btfArg, err := resolveBtfArg("bpf_lsm_"+f.Hook, a) | ||
if err != nil { | ||
return errFn(fmt.Errorf("Error on hook %q for index %d : %v", f.Hook, a.Index, err)) | ||
|