From 000d576ef877cb115cbb56f97187a1d62221e2bd Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Tue, 5 Dec 2023 15:28:15 +0100 Subject: [PATCH] revert: commit `9198f61759b7bf32e2aa207d8a1973b696f9875a` This PR https://github.com/falcosecurity/libs/pull/1160 is no more necessary since the issue is now fixed in libbpf library Signed-off-by: Andrea Terzolo --- driver/modern_bpf/CMakeLists.txt | 11 ----------- .../modern_bpf/helpers/extract/extract_from_kernel.h | 2 -- 2 files changed, 13 deletions(-) diff --git a/driver/modern_bpf/CMakeLists.txt b/driver/modern_bpf/CMakeLists.txt index d83074cf7a..f01a99eb25 100644 --- a/driver/modern_bpf/CMakeLists.txt +++ b/driver/modern_bpf/CMakeLists.txt @@ -8,9 +8,6 @@ option(MODERN_BPF_DEBUG_MODE "Enable BPF debug prints" OFF) option(MODERN_BPF_EXCLUDE_PROGS "Regex to exclude tail-called programs" "") -# This is a temporary workaround to solve this regression https://github.com/falcosecurity/libs/issues/1157 -# We need to find a better solution -option(MODERN_BPF_COS_WORKAROUND "Allow to correctly extract 'loginuid' from COS system, but requires at least CAP_SYS_ADMIN" OFF) ######################## # Debug mode @@ -23,13 +20,6 @@ else() endif() message(STATUS "${MODERN_BPF_LOG_PREFIX} MODERN_BPF_DEBUG_MODE: ${MODERN_BPF_DEBUG_MODE}") -if(MODERN_BPF_COS_WORKAROUND) - set(COS_WORKAROUND "COS_WORKAROUND") -else() - set(COS_WORKAROUND "") -endif() -message(STATUS "${MODERN_BPF_LOG_PREFIX} MODERN_BPF_COS_WORKAROUND: ${MODERN_BPF_COS_WORKAROUND}") - ######################## # Check kernel version. ######################## @@ -192,7 +182,6 @@ list(APPEND CLANG_FLAGS -g -O2 -target bpf -D__${DEBUG}__ - -D__${COS_WORKAROUND}__ -D__TARGET_ARCH_${ARCH} # Match libbpf usage in `/libbpf/src/bpf_tracing.h` -D__USE_VMLINUX__ # Used to compile without kernel headers. -I${LIBBPF_INCLUDE} diff --git a/driver/modern_bpf/helpers/extract/extract_from_kernel.h b/driver/modern_bpf/helpers/extract/extract_from_kernel.h index 7df2c67470..e80b8aff3c 100644 --- a/driver/modern_bpf/helpers/extract/extract_from_kernel.h +++ b/driver/modern_bpf/helpers/extract/extract_from_kernel.h @@ -723,7 +723,6 @@ static __always_inline void extract__loginuid(struct task_struct *task, uint32_t { READ_TASK_FIELD_INTO(loginuid, task, loginuid.val); } -#ifdef __COS_WORKAROUND__ else { struct task_struct___cos *task_cos = (void *)task; @@ -733,7 +732,6 @@ static __always_inline void extract__loginuid(struct task_struct *task, uint32_t BPF_CORE_READ_INTO(loginuid, task_cos, audit, loginuid.val); } } -#endif } /////////////////////////