Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-check-requirements : kernel config not found #1239

Closed
BobSquarePants opened this issue Dec 13, 2024 · 5 comments
Closed

-check-requirements : kernel config not found #1239

BobSquarePants opened this issue Dec 13, 2024 · 5 comments

Comments

@BobSquarePants
Copy link

Describe the bug

$ opensnitchd -check-requirements
❌ kernel config not found (6.6.63-v8_TESTTT+) in any of the expected paths

Include the following information

  • OpenSnitch version.
    1.6.6
  • OS:
    Devuan GNU/Linux 5 (daedalus)
  • Kernel version: echo $(uname -a)

Linux 6.6.63-v8_TESTTT+ #1 SMT PREEMPT aarch64 GNU/Linux

Additional context
I've build my own kernel in order to have the missing "modules"

Cross-compiled commands
su
apt install bc bison flex libssl-dev make libc6-dev libncurses5-dev crossbuild-essential-arm64

cd /tmp/LinuxKernel/linux

git clone --depth=1 --branch rpi-6.6.y https://github.com/raspberrypi/linux

cd linux
KERNEL=kernel8
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig

make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs
env PATH=$PATH make -j12 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- INSTALL_MOD_PATH=/to/sd_boot modules_install

cp /tmp/LinuxKernel/linux/Image /to/sd_boot/$KERNEL.img
cp /tmp/LinuxKernel/linux/dts/broadcom/*.dtb /to/sd_boot/
cp /tmp/LinuxKernel/linux/dts/overlays/*.dtb* /to/sd_boot/overlays/
cp /tmp/LinuxKernel/linux/dts/overlays/README /to/sd_boot/overlays/
umount /to/sd_boot/
umount /to/sd_root/
@gustavo-iniguez-goya
Copy link
Collaborator

gustavo-iniguez-goya commented Dec 13, 2024

Compile the kernel with the option CONFIG_IKCONFIG , it'll generate the file /proc/config.gz once the syste mboot up (you may need also to load the module configs).

Also see if the config file is under any of these paths:

	"/proc/config.gz"
	"/boot/config-$(uname -r)"
	"/usr/src/linux-$(uname -r)/.config"
	"/usr/src/linux/.config"
	"/usr/lib/modules/$(uname -r)/config"
	"/usr/lib/ostree-boot/config-$(uname -r)"
	"/usr/lib/kernel/config-$(uname -r)"
	"/usr/src/linux-headers-$(uname -r)/.config"
	"/lib/modules/$(uname -r)/build/.config"

@BobSquarePants
Copy link
Author

Thank you @gustavo-iniguez-goya

I had CONFIG_IKCONFIG set during compiling

CONFIG_IKCONFIG=m
CONFIG_IKCONFIG_PROC=y

but modprobe ikconfig return

FATAL: Module ikconfig not found in directory

I'll fix this and try to launch again opensnitchd -check-requirements

@BobSquarePants
Copy link
Author

ok so I've fixed the ikconfig and could run
opensnitchd -check-requirements

here the two fail of it

Checking => CONFIG_KPROBES_ON_FTRACE=y
KPROBES not fully supported by this kernel.

Checking => CONFIG_HAVE_KPROBES_ON_FTRACE=y
KPROBES not fully supported by this kernel.

While building my kernel ( 6.6.63 ) https://github.com/raspberrypi/linux
I couldn't active those two trough menuconfig

I guess those two features are not available in that kernel version ?

So will opensnitch works without them ?

Thanks.

@gustavo-iniguez-goya
Copy link
Collaborator

Yes, it should work.

We discussed that flag here: #1145

CONFIG_KPROBES_ON_FTRACE flag is not set for arm:
https://github.com/torvalds/linux/blob/master/Documentation/features/debug/kprobes-on-ftrace/arch-support.txt

So we could check the architecture when checking for that flag.

@BobSquarePants
Copy link
Author

BobSquarePants commented Dec 17, 2024

Thank you @gustavo-iniguez-goya indeed it's the same topic ( I'll close this one in a few )

So we could check the architecture when checking for that flag.

If you point me the file that host the code of the -check-requirements https://github.com/evilsocket/opensnitch/blob/master/daemon/core/system.go ,

I'll look if I can do a commit for it :)
edit: humm it's in .go ¯\(ツ)/¯, first I'll improve my git skill then I'll look back to it, if I figure out, how to do it in .go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants