libcap-ng/libcap-ng-0.9.3-cap-audit-task-comm-len.patch
Sergio Arroutbi afb7ad1ffe
Bump release to v0.9.3
Resolves: RHEL-160081

Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
2026-05-14 12:06:10 +02:00

25 lines
785 B
Diff

From: Sergio Arroutbi <sarroutb@redhat.com>
Subject: cap-audit: define TASK_COMM_LEN fallback for BPF compilation
vmlinux.h is generated from BTF data and contains only type/struct
definitions, not preprocessor macros. TASK_COMM_LEN is a #define in
linux/sched.h (value 16) and is not present in vmlinux.h, causing a
build failure when compiling the BPF program with clang.
Add a #ifndef guard to define it when missing.
diff --git a/utils/cap-audit/cap_audit.bpf.c b/utils/cap-audit/cap_audit.bpf.c
--- a/utils/cap-audit/cap_audit.bpf.c
+++ b/utils/cap-audit/cap_audit.bpf.c
@@ -27,6 +27,10 @@
#define CAP_OPT_NOAUDIT 2
#endif
+#ifndef TASK_COMM_LEN
+#define TASK_COMM_LEN 16
+#endif
+
#include <bpf/bpf_core_read.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>