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

Falco won't start on 0.36 - /sys/devices/system/cpu/cpu8/online: No such file or directory #2843

Closed
mateuszdrab opened this issue Sep 26, 2023 · 65 comments
Assignees
Labels
Milestone

Comments

@mateuszdrab
Copy link

Describe the bug

Since upgrading to 0.36 today - Falco won't start with the following:

/sys/devices/system/cpu/cpu8/online: No such file or directory

How to reproduce it

Upgrade to release 0.36 from 0.35

Expected behaviour

Falco starts

Screenshots

N/A

Environment

  • Falco version:
    0.36
  • System info:
  • Cloud provider or hardware configuration: ESXi VM
  • OS: Ubuntu 20.04.6
  • Kernel: 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Installation method: Helm/K3s

Additional context

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Hi! Thanks for reporting this issue.
Which driver are you using?

@mateuszdrab
Copy link
Author

mateuszdrab commented Sep 27, 2023

Thanks for picking it up @FedeDP
I forgot to mention - eBPF

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Can you share number of cpus of your node? By running nproc for example.

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Also, mind to share full Falco output? Thank you!

@mateuszdrab
Copy link
Author

That error came from a node with 8 cores (vcores).

Log looks like this:

2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Falco version: 0.36.0 (x86_64)
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Loading rules from file /etc/falco/falco_rules.yaml
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Loading rules from file /etc/falco/falco-incubating_rules.yaml
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Loading rules from file /etc/falco/falco-sandbox_rules.yaml
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Loading rules from file /etc/falco/rules.d/rules-custom.yaml
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: gRPC server threadiness equals to 8
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Starting health webserver with threadiness 8, listening on port 8765
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Loaded event sources: syscall
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Enabled event sources: syscall
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Opening 'syscall' source with BPF probe. BPF probe path: /root/.falco/falco-bpf.o
2023-09-26T20:26:55+01:00	Tue Sep 26 19:26:55 2023: Starting gRPC server at unix:///run/falco/falco.sock
2023-09-26T20:27:02+01:00	Tue Sep 26 19:27:02 2023: An error occurred in an event source, forcing termination...
2023-09-26T20:27:02+01:00	Tue Sep 26 19:27:02 2023: Shutting down gRPC server. Waiting until external connections are closed by clients
2023-09-26T20:27:02+01:00	Tue Sep 26 19:27:02 2023: Waiting for the gRPC threads to complete
2023-09-26T20:27:02+01:00	Tue Sep 26 19:27:02 2023: Draining all the remaining gRPC events
2023-09-26T20:27:02+01:00	Tue Sep 26 19:27:02 2023: Shutting down gRPC server complete
2023-09-26T20:27:02+01:00	Events detected: 0
2023-09-26T20:27:02+01:00	Rule counts by severity:
2023-09-26T20:27:02+01:00	Triggered rules by rule name:
2023-09-26T20:27:02+01:00	Error: can't open /sys/devices/system/cpu/cpu8/online: No such file or directory

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Thanks! Can you also share output of ls /sys/devices/system/cpu/cpu*, and cat /sys/devices/system/cpu/possible?

I mean, if the node has 8 cores, we should go from 0 to 7; moreover, the code has not been touched between Falco 0.35 and 0.36.

@mateuszdrab
Copy link
Author

 > ls /sys/devices/system/cpu/cpu*
/sys/devices/system/cpu/cpu0:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu1:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu2:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu3:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu4:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu5:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu6:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpu7:
cache  crash_notes  crash_notes_size  driver  firmware_node  hotplug  node0  online  power  subsystem  topology  uevent

/sys/devices/system/cpu/cpufreq:

/sys/devices/system/cpu/cpuidle:
current_driver  current_governor_ro
> cat /sys/devices/system/cpu/possible
0-127

It's a virtual machine with CPU hotplug enabled, could that have something to do with the possible value being at 127?

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

It's a virtual machine with CPU hotplug enabled, could that have something to do with the possible value being at 127?

Yep, that is a really weird value (i mean 0-127). Did anything change in between Falco 0.35 and Falco 0.36 deployments?

@mateuszdrab
Copy link
Author

mateuszdrab commented Sep 27, 2023

Nothing I'm aware of (homelab, it's all under my control), Falco is just kept up to date via Flux and as soon as the update was installed yesterday it went into the crash loop.
I had to change some values of the helm release to account for the rules files breaking changes but no other changes were made.
Since then it won't start - can try to roll back

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

can try to roll back

That would be great, thank you! If, in the same env, Falco 0.35 worked fine, we got a real bug :)

@Andreagit97 Andreagit97 added this to the 0.37.0 milestone Sep 27, 2023
@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Btw here is the blame: https://github.com/falcosecurity/libs/blame/762c23b98bd5bcdc5d680939d5b44cc2d92fb850/userspace/libscap/engine/bpf/scap_bpf.c#L1543

As you can see, the code hasn't been touched for months now.

@mateuszdrab
Copy link
Author

Rolled back to chart version 3.6.2 and everything is running happily...

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Very interesting, since the code is the same in both versions!
Can you share cat /sys/devices/system/cpu/possible once again?

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

Also, are you still using eBPF now?

@mateuszdrab
Copy link
Author

mateuszdrab commented Sep 27, 2023

Okay, my previous output was from the node, not the container...

Possible is the same in the working deployment (inside the container).

And yes, eBPF still. Modern eBPF won't start with a different error.

2023-09-26T20:36:19+01:00	Tue Sep 26 19:36:19 2023: Falco version: 0.36.0 (x86_64)
2023-09-26T20:36:19+01:00	Tue Sep 26 19:36:19 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
2023-09-26T20:36:19+01:00	Tue Sep 26 19:36:19 2023: Loading rules from file /etc/falco/falco_rules.yaml
2023-09-26T20:36:19+01:00	Tue Sep 26 19:36:19 2023: Loading rules from file /etc/falco/falco-incubating_rules.yaml
2023-09-26T20:36:19+01:00	Tue Sep 26 19:36:19 2023: Loading rules from file /etc/falco/falco-sandbox_rules.yaml
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Loading rules from file /etc/falco/rules.d/rules-custom.yaml
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: gRPC server threadiness equals to 8
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Starting health webserver with threadiness 8, listening on port 8765
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Loaded event sources: syscall
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Enabled event sources: syscall
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Opening 'syscall' source with modern BPF probe.
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: One ring buffer every '2' CPUs.
2023-09-26T20:36:20+01:00	libpman: ring buffer map type is not supported (errno: 22 | message: Invalid argument)
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: An error occurred in an event source, forcing termination...
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Starting gRPC server at unix:///run/falco/falco.sock
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Shutting down gRPC server. Waiting until external connections are closed by clients
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Waiting for the gRPC threads to complete
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Draining all the remaining gRPC events
2023-09-26T20:36:20+01:00	Tue Sep 26 19:36:20 2023: Shutting down gRPC server complete
2023-09-26T20:36:20+01:00	Events detected: 0
2023-09-26T20:36:20+01:00	Rule counts by severity:
2023-09-26T20:36:20+01:00	Triggered rules by rule name:
2023-09-26T20:36:21+01:00	Error: Initialization issues during scap_init

I tried using the legacy driver loader and it's still not happy.

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

I don't understand, so the real issue is:

2023-09-26T20:36:20+01:00 libpman: ring buffer map type is not supported (errno: 22 | message: Invalid argument)
?

@mateuszdrab
Copy link
Author

I don't understand, so the real issue is:

2023-09-26T20:36:20+01:00 libpman: ring buffer map type is not supported (errno: 22 | message: Invalid argument)
?

Yes, when using modern eBPF

When using old eBPF, the error is

Error: can't open /sys/devices/system/cpu/cpu8/online: No such file or directory

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

So, 0.35.1 was working fine, while 0.36.0 is broken.
Can you share:

getconf _NPROCESSORS_ONLN
getconf _NPROCESSORS_CONF

outputs on the node where Falco is running?

Again, that code has not been touched in this release cycle: https://github.com/falcosecurity/libs/blame/master/userspace/libscap/engine/bpf/scap_bpf.c#L1945

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

It's a virtual machine with CPU hotplug enabled, could that have something to do with the possible value being at 127?

I think so; it seems like a way for the vm to allow increasing number of online cpus (ie: CPUs made available to the vm) without the need to reboot. I think Falco is not able to correctly manage this situation at the moment.
Fact is, i don't get how could Falco 0.35.1 work in the very same situation.

@mateuszdrab
Copy link
Author

mateuszdrab commented Sep 27, 2023

Here it is

getconf _NPROCESSORS_ONLN
8
getconf _NPROCESSORS_CONF
8

It is not starting on any node, and they've not had any core count changed lately.
I've even rebooted one node to make sure it's not reboot related.

@FedeDP
Copy link
Contributor

FedeDP commented Sep 27, 2023

The 2 getconfs are the exact same numbers we use in code to:

  • fetch number of configured processors
  • fetch number of online processor

Before, you said that

cat /sys/devices/system/cpu/possible

returned 0-127; i'd expect _NPROCESSORS_CONF to be 128 actually.

@mateuszdrab
Copy link
Author

mateuszdrab commented Sep 27, 2023

🤯

At least if it didn't work in the previous version I'd suspect something else, kernel upgrade for example.
It doesn't help that this seems to work in previous version and not this one.

Let me know what else I could try.

I'm just rolling back to the previous version for now

@FedeDP
Copy link
Contributor

FedeDP commented Sep 28, 2023

It doesn't help that this seems to work in previous version and not this one.

Exactly, that's so weird.
Last thing: can you share a cat /sys/devices/system/cpu/possible from within the 0.35.1 Falco pod too?

(Fact is, i know what needs to be fixed, but until we actually understand why it was working on 0.35, i won't push any PR!)

@FedeDP
Copy link
Contributor

FedeDP commented Sep 28, 2023

The patch is ready: falcosecurity/libs#1373
Still, i'd love to understand what's going on here :D

@mateuszdrab
Copy link
Author

It's the same - cat /sys/devices/system/cpu/possible is 0-127 🤯

@mateuszdrab
Copy link
Author

Got a build/image I can try?

@leogr
Copy link
Member

leogr commented Oct 6, 2023

/milestone 0.36.1

@poiana poiana modified the milestones: 0.37.0, 0.36.1 Oct 6, 2023
@Andreagit97
Copy link
Member

@tks98 @mateuszdrab Falco 0.36.1-rc1 is out if you want to give it a try! Let us know if it solves your issue

@mateuszdrab
Copy link
Author

mateuszdrab commented Oct 16, 2023

Hey @Andreagit97

Thank you for letting me know

Using the latest chart with substituted image tag, I get the below when starting:

falco Mon Oct 16 08:28:10 2023: Falco version: 0.36.1-rc1 (x86_64)
falco Mon Oct 16 08:28:10 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
falco Mon Oct 16 08:28:10 2023: Loading rules from file /etc/falco/falco_rules.yaml
falco Mon Oct 16 08:28:11 2023: Loading rules from file /etc/falco/falco-incubating_rules.yaml
falco Mon Oct 16 08:28:11 2023: Loading rules from file /etc/falco/falco-sandbox_rules.yaml
falco Mon Oct 16 08:28:11 2023: Loading rules from file /etc/falco/rules.d/rules-custom.yaml
falco Mon Oct 16 08:28:11 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
falco Mon Oct 16 08:28:11 2023: gRPC server threadiness equals to 2
falco Mon Oct 16 08:28:11 2023: Starting health webserver with threadiness 2, listening on port 8765
falco Mon Oct 16 08:28:11 2023: Starting gRPC server at unix:///run/falco/falco.sock
falco Mon Oct 16 08:28:11 2023: Loaded event sources: syscall
falco Mon Oct 16 08:28:11 2023: Enabled event sources: syscall
falco Mon Oct 16 08:28:11 2023: Opening 'syscall' source with BPF probe. BPF probe path: /root/.falco/falco-bpf.o
falco Mon Oct 16 08:28:11 2023: An error occurred in an event source, forcing termination...
falco Mon Oct 16 08:28:11 2023: Shutting down gRPC server. Waiting until external connections are closed by clients
falco Mon Oct 16 08:28:11 2023: Waiting for the gRPC threads to complete
falco Mon Oct 16 08:28:11 2023: Draining all the remaining gRPC events
falco Mon Oct 16 08:28:11 2023: Shutting down gRPC server complete
falco Events detected: 0
falco Rule counts by severity:
falco Triggered rules by rule name:
falco Error: failure populating program array: Operation not permitted
Stream closed EOF for falco/falco-tkw24 (falco)

@Andreagit97
Copy link
Member

It seems strange since we didn't touch the drivers at all, I will take a look 👀 thank you for reporting!

@Andreagit97
Copy link
Member

Andreagit97 commented Oct 16, 2023

@mateuszdrab it seems like Falco is trying to use an old driver version, could you try a fresh installation with helm uninstall ... and then helm install .... I've tried it on a GKE cluster and it seems to work fine, this is how I modified the latest helm chart falco-3.7.1

diff --git a/falco/values.yaml b/falco/values.yaml
index bbf6a5f..5e5980d 100644
--- a/falco/values.yaml
+++ b/falco/values.yaml
@@ -12,7 +12,7 @@ image:
   # -- The image repository to pull from
   repository: falcosecurity/falco-no-driver
   # -- The image tag to pull. Overrides the image tag whose default is the chart appVersion.
-  tag: ""
+  tag: "0.36.1-rc1"
 
 # -- Secrets containing credentials when pulling from private/secure registries.
 imagePullSecrets: []
@@ -179,7 +179,7 @@ driver:
   # Always set it to false when using Falco with plugins.
   enabled: true
   # -- Tell Falco which driver to use. Available options: module (kernel driver), ebpf (eBPF probe), modern-bpf (modern eBPF probe).
-  kind: module
+  kind: ebpf
   # -- Configuration section for ebpf driver.
   ebpf:
     # -- Path where the eBPF probe is located. It comes handy when the probe have been installed in the nodes using tools other than the init
@@ -215,7 +215,7 @@ driver:
         # -- The image repository to pull from.
         repository: falcosecurity/falco-driver-loader
         #  -- Overrides the image tag whose default is the chart appVersion.
-        tag: ""
+        tag: "0.36.1-rc1"
       # -- Extra environment variables that will be pass onto Falco driver loader init container.
       env: []
       # -- Arguments to pass to the Falco driver loader init container.

If I remember well you were using Falco 0.35.1, is it possible that you are running Falco 0.36.1 with the ebpf probe of Falco 0.35.1?

@mateuszdrab
Copy link
Author

Wohoo, it's running... forgot to override the driver installer image

    driver:
      kind: ebpf
      loader:
        initContainer:
          tag: 0.36.1-rc1
    image:
      tag: 0.36.1-rc1

@Andreagit97
Copy link
Member

Thank you very much for testing it!

@mateuszdrab
Copy link
Author

You're welcome, thanks for fixing the issue so quick

@Andreagit97
Copy link
Member

Falco 0.36.1 is out! It should solve the issue. I will close it, feel free to reopen it if you face other issues

@mateuszdrab
Copy link
Author

Awesome, I'll remove the image override from the Flux HelmRelease when I get home and report back if there's any issues.

@ShaikhMJAM
Copy link

Hi I am facing same issue I have install falco through helm

@Andreagit97
Copy link
Member

ei @ShaikhMJAM which Falco version are you using?

@ShaikhMJAM
Copy link

I am using 0.36.2 version

@Andreagit97
Copy link
Member

uhm interesting, could you provide the full Falco logs with the error?

@ShaikhMJAM
Copy link

$ kubectl logs ds/falco -n falco
Found 5 pods, using pod/falco-nszhd
Defaulted container "falco" out of: falco, falcoctl-artifact-follow, falcoctl-artifact-install (init)
Tue Nov 7 10:13:19 2023: Falco version: 0.36.2 (x86_64)
Tue Nov 7 10:13:19 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
Tue Nov 7 10:13:19 2023: Loading rules from file /etc/falco/falco_rules.yaml
Tue Nov 7 10:13:19 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
Tue Nov 7 10:13:19 2023: Starting health webserver with threadiness 2, listening on port 8765
Tue Nov 7 10:13:19 2023: Loaded event sources: syscall
Tue Nov 7 10:13:19 2023: Enabled event sources: syscall
Tue Nov 7 10:13:19 2023: Opening 'syscall' source with modern BPF probe.
Tue Nov 7 10:13:19 2023: One ring buffer every '2' CPUs.
libbpf: prog 'sys_enter': BPF program load failed: Invalid argument
libbpf: prog 'sys_enter': -- BEGIN PROG LOAD LOG --
; int BPF_PROG(sys_enter,
0: (bf) r6 = r1
; int BPF_PROG(sys_enter,
1: (79) r7 = *(u64 *)(r6 +8)
; return g_64bit_interesting_syscalls_table[syscall_id & (SYSCALL_TABLE_SIZE - 1)];
2: (bf) r1 = r7
3: (57) r1 &= 511
; return g_64bit_interesting_syscalls_table[syscall_id & (SYSCALL_TABLE_SIZE - 1)];
4: (18) r2 = 0xffffab6c4102a000
6: (0f) r2 += r1
last_idx 6 first_idx 0
regs=2 stack=0 before 4: (18) r2 = 0xffffab6c4102a000
regs=2 stack=0 before 3: (57) r1 &= 511
regs=2 stack=0 before 2: (bf) r1 = r7
regs=80 stack=0 before 1: (79) r7 = *(u64 *)(r6 +8)
7: (71) r2 = *(u8 *)(r2 +0)
R1_w=invP(id=0,umax_value=511,var_off=(0x0; 0x1ff)) R2_w=map_value(id=0,off=0,ks=4,vs=242537,umax_value=511,var_off=(0x0; 0x1ff)) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; if(!syscalls_dispatcher__64bit_interesting_syscall(syscall_id))
8: (15) if r2 == 0x0 goto pc+76
R1_w=invP(id=0,umax_value=511,var_off=(0x0; 0x1ff)) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; return g_settings.dropping_mode;
9: (18) r2 = 0xffffab6c4102a5a8
11: (71) r2 = *(u8 *)(r2 +12)
R1_w=invP(id=0,umax_value=511,var_off=(0x0; 0x1ff)) R2_w=map_value(id=0,off=1448,ks=4,vs=242537,imm=0) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; if(!maps__get_dropping_mode())
12: (15) if r2 == 0x0 goto pc+37
R1_w=invP(id=0,umax_value=511,var_off=(0x0; 0x1ff)) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; return g_64bit_sampling_syscall_table[syscall_id & (SYSCALL_TABLE_SIZE - 1)];
13: (18) r2 = 0xffffab6c4102a200
15: (0f) r2 += r1
16: (71) r1 = *(u8 *)(r2 +0)
R1_w=invP(id=0,umax_value=511,var_off=(0x0; 0x1ff)) R2_w=map_value(id=0,off=512,ks=4,vs=242537,umax_value=511,var_off=(0x0; 0x1ff)) R6_w=ctx(id=0,off=0,imm=0) R7_w=inv(id=0) R10=fp0
; if(sampling_flag == UF_NEVER_DROP)
17: (15) if r1 == 0x2 goto pc+32
R1=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R2=map_value(id=0,off=512,ks=4,vs=242537,umax_value=511,var_off=(0x0; 0x1ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0
18: (15) if r1 == 0x4 goto pc+66
R1=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R2=map_value(id=0,off=512,ks=4,vs=242537,umax_value=511,var_off=(0x0; 0x1ff)) R6=ctx(id=0,off=0,imm=0) R7=inv(id=0) R10=fp0
; if((bpf_ktime_get_boot_ns() % SECOND_TO_NS) >= (SECOND_TO_NS / maps__get_sampling_ratio()))
19: (85) call bpf_uuused15#125
unknown func bpf_uuused15#125
processed 17 insns (limit 1000000) max_states_per_insn 0 total_states 1 peak_states 1 mark_read 1
-- END PROG LOAD LOG --
libbpf: prog 'sys_enter': failed to load: -22
libbpf: failed to load object 'bpf_probe'
libbpf: failed to load BPF skeleton 'bpf_probe': -22
libpman: failed to load BPF object (errno: 22 | message: Invalid argument)
Tue Nov 7 10:13:19 2023: An error occurred in an event source, forcing termination...
Events detected: 0
Rule counts by severity:
Triggered rules by rule name:
Error: Initialization issues during scap_init

@Andreagit97
Copy link
Member

uhm this seems not related to this issue, but it is related to this one #2792
Probably this is due to a wrong backporting in the kernel you are using :/ Just for curiosity which kernel version are you using?

@ShaikhMJAM
Copy link

$ uname -r
5.4.17-2136.300.7.el8uek.x86_64

@Andreagit97
Copy link
Member

yes apart from the patch version is the same kernel version of the other issue... The best solution here is not to use the modern bpf at all. We don't know which helpers are backported or not... the suggestion here is to switch to a recent kernel version ASAP or to use one of the other 2 drivers (legacy_bpf,kernel module) if possible

@ShaikhMJAM
Copy link

ok, Can you help me with changing driver, How we change the driver

@Andreagit97
Copy link
Member

if you are using the official falco helm chart to deploy falco you need to update the driver.kind config:

# Driver settings (scenario requirement)
driver:
  # -- Set it to false if you want to deploy Falco without the drivers.
  # Always set it to false when using Falco with plugins.
  enabled: true
  # -- Tell Falco which driver to use. Available options: module (kernel driver), ebpf (eBPF probe), modern-bpf (modern eBPF probe).
  kind: ebpf

In this example I've used the legacy ebpf probe

@ShaikhMJAM
Copy link

Hey I have reinstall falco by using this command "helm install falco falcosecurity/falco --set driver.kind=legacy_bpf" but still it is not woking

@Andreagit97
Copy link
Member

the right command is --set driver.kind=ebpf

@ShaikhMJAM
Copy link

no its not working

@Andreagit97
Copy link
Member

could you log the error please?

@ShaikhMJAM
Copy link

[root@kubernet-master-09 ~]# kubectl logs ds/falco -n falco
Found 5 pods, using pod/falco-xv4s7
Defaulted container "falco" out of: falco, falcoctl-artifact-follow, falco-driver-loader (init), falcoctl-artifact-install (init)
Tue Nov 7 12:05:58 2023: Falco version: 0.36.2 (x86_64)
Tue Nov 7 12:05:58 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
Tue Nov 7 12:05:58 2023: Loading rules from file /etc/falco/falco_rules.yaml
Tue Nov 7 12:05:58 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
Tue Nov 7 12:05:58 2023: Starting health webserver with threadiness 2, listening on port 8765
Tue Nov 7 12:05:58 2023: Loaded event sources: syscall
Tue Nov 7 12:05:58 2023: Enabled event sources: syscall
Tue Nov 7 12:05:58 2023: Opening 'syscall' source with BPF probe. BPF probe path: /root/.falco/falco-bpf.o
-- BEGIN PROG LOAD LOG --
0: (bf) r6 = r1
1: (b7) r1 = 0
2: (63) *(u32 *)(r10 -32) = r1
last_idx 2 first_idx 0
regs=2 stack=0 before 1: (b7) r1 = 0
3: (bf) r2 = r10
4: (07) r2 += -32
5: (18) r1 = 0xffff9aa83a511800
7: (85) call bpf_map_lookup_elem#1
8: (15) if r0 == 0x0 goto pc+904
R0_w=map_value(id=0,off=0,ks=4,vs=35,imm=0) R6_w=ctx(id=0,off=0,imm=0) R10=fp0 fp-32=????mmmm
9: (85) call bpf_get_smp_processor_id#8
10: (bf) r9 = r0
11: (63) *(u32 *)(r10 -32) = r9
12: (bf) r2 = r10
13: (07) r2 += -32
14: (18) r1 = 0xffffab6c41b01000
16: (85) call bpf_map_lookup_elem#1
17: (bf) r8 = r0
18: (15) if r8 == 0x0 goto pc+894
R0_w=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R6=ctx(id=0,off=0,imm=0) R8_w=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9_w=inv(id=0) R10=fp0 fp-32=????mmmm
19: (63) *(u32 *)(r10 -32) = r9
20: (bf) r2 = r10
21: (07) r2 += -32
22: (18) r1 = 0xffff9aa8afe5e000
24: (85) call bpf_map_lookup_elem#1
25: (bf) r7 = r0
26: (15) if r7 == 0x0 goto pc+886
R0=map_value(id=0,off=0,ks=4,vs=197,imm=0) R6=ctx(id=0,off=0,imm=0) R7_w=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv(id=0) R10=fp0 fp-32=????mmmm
27: (63) *(u32 *)(r10 -32) = r9
28: (bf) r2 = r10
29: (07) r2 += -32
30: (18) r1 = 0xffffab6c44f01000
32: (85) call bpf_map_lookup_elem#1
33: (18) r9 = 0xfffffffd
35: (15) if r0 == 0x0 goto pc+868
R0=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm
36: (71) r1 = *(u8 *)(r7 +1)
R0=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm
37: (67) r1 <<= 8
38: (71) r2 = *(u8 *)(r7 +0)
R0=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R1_w=inv(id=0,umax_value=65280,var_off=(0x0; 0xff00)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm
39: (4f) r1 |= r2
40: (71) r2 = *(u8 *)(r7 +2)
R0=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R1_w=inv(id=0) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm
41: (71) r3 = *(u8 *)(r7 +3)
R0=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R1_w=inv(id=0) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm
42: (67) r3 <<= 8
43: (4f) r3 |= r2
44: (67) r3 <<= 16
45: (4f) r3 |= r1
46: (63) *(u32 *)(r10 -32) = r3
47: (bf) r2 = r10
48: (07) r2 += -32
49: (18) r1 = 0xffffab6c410e9000
51: (85) call bpf_map_lookup_elem#1
52: (7b) *(u64 *)(r10 -40) = r0
53: (15) if r0 == 0x0 goto pc+850
R0=map_value(id=0,off=0,ks=4,vs=1840,imm=0) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40_w=map_value
54: (71) r1 = *(u8 *)(r7 +1)
R0=map_value(id=0,off=0,ks=4,vs=1840,imm=0) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40_w=map_value
55: (67) r1 <<= 8
56: (71) r2 = *(u8 *)(r7 +0)
R0=map_value(id=0,off=0,ks=4,vs=1840,imm=0) R1_w=inv(id=0,umax_value=65280,var_off=(0x0; 0xff00)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40_w=map_value
57: (4f) r1 |= r2
58: (71) r2 = *(u8 *)(r7 +2)
R0=map_value(id=0,off=0,ks=4,vs=1840,imm=0) R1_w=inv(id=0) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40_w=map_value
59: (71) r3 = *(u8 *)(r7 +3)
R0=map_value(id=0,off=0,ks=4,vs=1840,imm=0) R1_w=inv(id=0) R2_w=inv(id=0,umax_value=255,var_off=(0x0; 0xff)) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40_w=map_value
60: (67) r3 <<= 8
61: (4f) r3 |= r2
62: (67) r3 <<= 16
63: (4f) r3 |= r1
64: (63) *(u32 *)(r10 -32) = r3
65: (bf) r2 = r10
66: (07) r2 += -32
67: (18) r1 = 0xffff9aa816b10000
69: (85) call bpf_map_lookup_elem#1
70: (15) if r0 == 0x0 goto pc+833
R0=map_value(id=0,off=0,ks=4,vs=58,imm=0) R6=ctx(id=0,off=0,imm=0) R7=map_value(id=0,off=0,ks=4,vs=197,imm=0) R8=map_value(id=0,off=0,ks=4,vs=262144,imm=0) R9=inv4294967293 R10=fp0 fp-32=????mmmm fp-40=map_value
71: (71) r2 = *(u8 *)(r7 +29)

@Andreagit97
Copy link
Member

uhm another verifier error... what about the kernel module helm install falco falcosecurity/falco --set driver.kind=module? 🤞 Let's hope it works otherwise the only option you have at the moment is to use another kernel version, sorry :/

@ShaikhMJAM
Copy link

No its not working but now it is giving different error
$ kubectl logs ds/falco -n falco
Found 5 pods, using pod/falco-86vjx
Defaulted container "falco" out of: falco, falcoctl-artifact-follow, falco-driver-loader (init), falcoctl-artifact-install (init)
Error from server (BadRequest): container "falco" in pod "falco-86vjx" is waiting to start: PodInitializing

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

No branches or pull requests

7 participants