diff --git a/pkg/alignchecker/alignchecker.go b/pkg/alignchecker/alignchecker.go index cd5280b30dc..56b0c2c00ec 100644 --- a/pkg/alignchecker/alignchecker.go +++ b/pkg/alignchecker/alignchecker.go @@ -32,7 +32,7 @@ func CheckStructAlignments(pathToObj string) error { "msg_execve_key": {processapi.MsgExecveKey{}}, "execve_map_value": {execvemap.ExecveValue{}}, "msg_cgroup_event": {processapi.MsgCgroupEvent{}}, - "msg_cred": {tracingapi.MsgGenericCred{}}, + "msg_cred": {processapi.MsgGenericCred{}}, "msg_cred_minimal": {processapi.MsgGenericCredMinimal{}}, // configuration diff --git a/pkg/api/processapi/processapi.go b/pkg/api/processapi/processapi.go index dffcec3da15..e418c80846a 100644 --- a/pkg/api/processapi/processapi.go +++ b/pkg/api/processapi/processapi.go @@ -90,6 +90,21 @@ type MsgK8sUnix struct { Docker string } +type MsgGenericCred struct { + Uid uint32 + Gid uint32 + Suid uint32 + Sgid uint32 + Euid uint32 + Egid uint32 + FSuid uint32 + FSgid uint32 + SecureBits uint32 + Pad uint32 + Cap MsgCapabilities + UserNs MsgUserNamespace +} + type MsgGenericCredMinimal struct { Uid uint32 Gid uint32 diff --git a/pkg/api/tracingapi/client_kprobe.go b/pkg/api/tracingapi/client_kprobe.go index 8f3fa8d8a4c..87656cf4047 100644 --- a/pkg/api/tracingapi/client_kprobe.go +++ b/pkg/api/tracingapi/client_kprobe.go @@ -271,21 +271,6 @@ func (m MsgGenericKprobeArgNetDev) IsReturnArg() bool { return m.Index == ReturnArgIndex } -type MsgGenericCred struct { - Uid uint32 - Gid uint32 - Suid uint32 - Sgid uint32 - Euid uint32 - Egid uint32 - FSuid uint32 - FSgid uint32 - SecureBits uint32 - Pad uint32 - Cap processapi.MsgCapabilities - UserNs processapi.MsgUserNamespace -} - type MsgGenericKprobeArgCred struct { Index uint64 Uid uint32 diff --git a/pkg/sensors/tracing/args.go b/pkg/sensors/tracing/args.go index 103c32d3b78..f9a673cf596 100644 --- a/pkg/sensors/tracing/args.go +++ b/pkg/sensors/tracing/args.go @@ -11,7 +11,7 @@ import ( "io" "github.com/cilium/tetragon/pkg/api/dataapi" - "github.com/cilium/tetragon/pkg/api/tracingapi" + processapi "github.com/cilium/tetragon/pkg/api/processapi" api "github.com/cilium/tetragon/pkg/api/tracingapi" gt "github.com/cilium/tetragon/pkg/generictypes" "github.com/cilium/tetragon/pkg/k8s/apis/cilium.io/v1alpha1" @@ -74,7 +74,7 @@ func getTracepointMetaValue(arg *v1alpha1.KProbeArg) int { return 0 } -func getArg(r *bytes.Reader, a argPrinter) tracingapi.MsgGenericKprobeArg { +func getArg(r *bytes.Reader, a argPrinter) api.MsgGenericKprobeArg { var err error switch a.ty { @@ -176,7 +176,7 @@ func getArg(r *bytes.Reader, a argPrinter) tracingapi.MsgGenericKprobeArg { arg.Label = a.label return arg case gt.GenericCredType: - var cred api.MsgGenericCred + var cred processapi.MsgGenericCred var arg api.MsgGenericKprobeArgCred err := binary.Read(r, binary.LittleEndian, &cred)