Closed jkbuster-work19 closed 2 years ago
I'm encountering the same issue.
Here is my config:
kernelrelease: 5.10.15-1
kernelversion: 1
target: centos
output:
module: /tmp/falco-centos7.ko
probe: /tmp/falco-probe-bpf.o
driverversion: 5c0b863ddade7a45568c0ac97d037422c9efb750
Here is the error message:
DEBU %+ ln -sf /usr/bin/gcc-8 /usr/bin/gcc
DEBU .+ cd /tmp/driver
DEBU + make KERNELDIR=/tmp/kernel
DEBU *make -C /tmp/kernel M=/tmp/driver modules
DEBU *make[1]: Entering directory '/tmp/kernel'
DEBU CC [M] /tmp/driver/main.o
DEBU - CC [M] /tmp/driver/dynamic_params_table.o
DEBU & CC [M] /tmp/driver/fillers_table.o
DEBU $ CC [M] /tmp/driver/flags_table.o
DEBU # CC [M] /tmp/driver/ppm_events.o
DEBU $ CC [M] /tmp/driver/ppm_fillers.o
DEBU $ CC [M] /tmp/driver/event_table.o
DEBU & CC [M] /tmp/driver/syscall_table.o
DEBU $ CC [M] /tmp/driver/ppm_cputime.o
DEBU LD [M] /tmp/driver/falco.o
DEBU % MODPOST /tmp/driver/Module.symvers
DEBU " CC [M] /tmp/driver/falco.mod.o
DEBU LD [M] /tmp/driver/falco.ko
DEBU )make[1]: Leaving directory '/tmp/kernel'
DEBU + modinfo falco.ko
DEBU filename: /tmp/driver/falco.ko
DEBU author: sysdig inc
DEBU license: GPL
DEBU srcversion: B4FFE3CC859ECD9E48D3EB7
DEBU depends:
DEBU retpoline: Y
DEBU name: falco
DEBU vermagic: 5.10.15-1.el7.elrepo.x86_64 SMP mod_unload modversions
DEBU parm: max_consumers:Maximum number of consumers that can simultaneously open the devices (uint)
DEBU parm: verbose:Enable verbose logging (bool)
DEBU l+ cd /tmp/driver/bpf
DEBU + make LLC=/usr/bin/llc-7 CLANG=/usr/bin/clang-7 CC=/usr/bin/gcc KERNELDIR=/tmp/kernel
DEBU ake -C /tmp/kernel M=$PWD
DEBU *make[1]: Entering directory '/tmp/kernel'
DEBU Nscripts/Makefile.lib:8: 'always' is deprecated. Please use 'always-y' instead
DEBU /usr/bin/clang-7 -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h \
DEBU -D__KERNEL__ -fmacro-prefix-map=./= \
DEBU \
DEBU \
DEBU -D__KERNEL__ \
DEBU -D__BPF_TRACING__ \
DEBU -Wno-gnu-variable-sized-type-not-at-end \
DEBU -Wno-address-of-packed-member \
DEBU -fno-jump-tables \
DEBU -fno-stack-protector \
DEBU -Wno-tautological-compare \
DEBU -O2 -g -emit-llvm -c /tmp/driver/bpf/probe.c -o /tmp/driver/bpf/probe.ll
DEBU 9clang: error: unknown argument: '-fmacro-prefix-map=./='
DEBU Lmake[2]: *** [/tmp/driver/bpf/Makefile:33: /tmp/driver/bpf/probe.o] Error 1
DEBU 6make[1]: *** [Makefile:1801: /tmp/driver/bpf] Error 2
DEBU )make[1]: Leaving directory '/tmp/kernel'
DEBU %make: *** [Makefile:18: all] Error 2
I tried to compile with vanilla upstream headers. I didn't run into the issues above but wanted to share my experience in case it's helpful to anyone.
I used the following manifest to try to compile a module and probe for v2605.6.0
:
kernelrelease: 5.4.67
kernelversion: 1
target: vanilla
output:
probe: /tmp/falco-flatcar-2605.6.0.o
module: /tmp/falco-flatcar-2605.6.0.ko
driverversion: 2aa88dcf6243982697811df4c1b484bcbe9488a2
kernelconfigdata: <redacted>
Invoked with driverkit docker -c flatcar.yaml --timeout 300
This built successfully, but after rsyncing the built module to my test vagrant and running insmod
, I am getting:
localhost core # insmod /home/core/falco-flatcar-2605.6.0.ko
insmod: ERROR: could not insert module /home/core/falco-flatcar-2605.6.0.ko: Invalid module format
I suspect that this is because flatcar maintains their own fork of the kernel that differs from vanilla.
For this reason, I think you would need to build a custom builder, eluded to in the README here:
You probably came here because you want to tell the Falco Drivers Build Grid to build drivers for a specific distro you care about.
If that distribution is not supported by driverkit, the Falco Drivers Build Grid will not be able to just build it as it does for other distros.
....
I looked at other builders to see what would be necessary to create one for flatcar, and it seems they all fetch kernel headers from URLs, such as in the case of ubuntu, and even vanilla.
The blocker I am facing currently is that I don't think Kinvolk publishes their headers files anywhere, but instead keep them on disk after an installation, mentioned here.
I tried searching their upstream for kernel images and such but headers aren't included: https://stable.release.flatcar-linux.net/
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Provide feedback via https://github.com/falcosecurity/community. /close
@poiana: Closing this issue.
Describe the bug
driverkit scripts do not work for current Flatcar release (Kernel 5.10.25)
How to reproduce it
configs/flatcar-2765.2.2.yaml:
Run:
Expected behaviour
eBPF probe builds for desired kernel
Screenshots
Initially, it appears that python3 is needed:
After adding that into the driverkit-builder image, things get stuck due to
-fmacro-prefix-map
:Additional context
It appears that
-fmacro-prefix-map
wasn't added until clang-10 link, which is unavailable in the current Debian-stable release.However, rebuilding the driverkit-builder image on Sid also throws errors when trying to run
gcc-8
, which is only available on Debian-stable: