From 1a7b15abb3d48802f7f44d44a1c2c7cb58ec51f7 Mon Sep 17 00:00:00 2001 From: Anastasios Papagiannis Date: Tue, 30 Jul 2024 08:05:28 +0000 Subject: [PATCH] Add LoadLSMProgramSimple https://github.com/cilium/tetragon/commit/0b090efc47f89f80336db39b365d54fa25979327 modifies LoadLSMProgram to be gelenic_lsm specific. This patch adds LoadLSMProgramSimple that is generic enough to be used in other use cases. Signed-off-by: Anastasios Papagiannis --- pkg/sensors/program/loader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/sensors/program/loader.go b/pkg/sensors/program/loader.go index 909ce01d531..62641b5ed1b 100644 --- a/pkg/sensors/program/loader.go +++ b/pkg/sensors/program/loader.go @@ -704,6 +704,13 @@ func LoadLSMProgram(bpfDir string, load *Program, verbose int) error { return loadProgram(bpfDir, load, opts, verbose) } +func LoadLSMProgramSimple(bpfDir string, load *Program, verbose int) error { + opts := &LoadOpts{ + Attach: LSMAttach(), + } + return loadProgram(bpfDir, load, opts, verbose) +} + func LoadMultiUprobeProgram(bpfDir string, load *Program, verbose int) error { tc := tailCall{fmt.Sprintf("%s-up_calls", load.PinPath), "uprobe"} opts := &LoadOpts{