Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anfedotoff committed Jun 26, 2024
1 parent 1103c0b commit a9f28bf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/sensors/tracing/genericlsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ func createGenericLsmSensor(
var selMaps *selectors.KernelSelectorMaps
var err error

if !kernels.MinKernelVersion("5.7") {
return nil, fmt.Errorf("To load LSM sensor kernel version must be greater or equal 5.7")
}

lsmHooks := spec.LsmHooks

in := addLsmIn{
Expand Down Expand Up @@ -323,12 +327,12 @@ func createGenericLsmSensor(
func createLsmSensorFromEntry(lsmEntry *genericLsm, sensorPath string,
progs []*program.Program, maps []*program.Map) ([]*program.Program, []*program.Map) {

loadProgName := "bpf_generic_lsm_v511.o"
/*if kernels.EnableV61Progs() {
loadProgName = "bpf_generic_uprobe_v61.o"
} else if kernels.EnableLargeProgs() {
loadProgName = "bpf_generic_uprobe_v53.o"
}*/
loadProgName := "bpf_generic_lsm.o"
if kernels.EnableV61Progs() {
loadProgName = "bpf_generic_lsm_v61.o"
} else if kernels.MinKernelVersion("5.11") {
loadProgName = "bpf_generic_lsm_v511.o"
}

pinPath := lsmEntry.pinPathPrefix
pinProg := sensors.PathJoin(pinPath, fmt.Sprintf("%s_prog", lsmEntry.hook))
Expand Down

0 comments on commit a9f28bf

Please sign in to comment.