Skip to contentSkip to conversation

bpftool: disable bpfilter kernel config checks

PATCH In review Chethan Suresh 4 participants 5 messages Jan 25, 2023 – Feb 1, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpftool: disable bpfilter kernel config checks

We've experienced similar issues about bpfilter like below:
https://github.com/moby/moby/issues/43755
https://lore.kernel.org/bpf/CAADnVQJ5MxGkq=ng214aYoH-NmZ1gjoS=ZTY1eU-Fag4RwZjdg@mail.gmail.com/

Considering the current development status of bpfilter, disable bpfilter kernel config checks in bpftool feature. For production system, we should disable both CONFIG_BPFILTER and CONFIG_BPFILTER_UMH for now. Or can be enabled as some tools depend on bpfilter.

---
 tools/bpf/bpftool/feature.c | 4 ----
 1 file changed, 4 deletions(-)
tools/bpf/bpftool/feature.c +0 -4
index 36cf0f1517c9..c6087bbc6613 100644
@@ -426,10 +426,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		{ "CONFIG_BPF_STREAM_PARSER", },
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
-		/* bpfilter back-end for iptables */
-		{ "CONFIG_BPFILTER", },
-		/* bpftilter module with "user mode helper" */
-		{ "CONFIG_BPFILTER_UMH", },
 
 		/* test_bpf module for BPF tests */
 		{ "CONFIG_TEST_BPF", },
Signature · 1 line
2.17.1
#1 lore raw

2023-01-25 08:25 UTC+0530 ~ Chethan Suresh <[email protected]>

Quoted 21 lines

We've experienced similar issues about bpfilter like below:
https://github.com/moby/moby/issues/43755
https://lore.kernel.org/bpf/CAADnVQJ5MxGkq=ng214aYoH-NmZ1gjoS=ZTY1eU-Fag4RwZjdg@mail.gmail.com/

Considering the current development status of bpfilter, disable bpfilter kernel config checks in bpftool feature. For production system, we should disable both CONFIG_BPFILTER and CONFIG_BPFILTER_UMH for now. Or can be enabled as some tools depend on bpfilter.

---
 tools/bpf/bpftool/feature.c | 4 ----
 1 file changed, 4 deletions(-)
tools/bpf/bpftool/feature.c +0 -0
index 36cf0f1517c9..c6087bbc6613 100644

tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 431

Quoted 10 lines
tools/bpf/bpftool/feature.c +0 -4
@@ -426,10 +426,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		{ "CONFIG_BPF_STREAM_PARSER", },
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
-		/* bpfilter back-end for iptables */
-		{ "CONFIG_BPFILTER", },
-		/* bpftilter module with "user mode helper" */
-		{ "CONFIG_BPFILTER_UMH", },
 
 		/* test_bpf module for BPF tests */
 		{ "CONFIG_TEST_BPF", },

Hi,
I don't understand. The feature probe simply looks for the kconfig option in the kconfig file. What are you hoping to achieve by removing this check? How is it going to help with your issues?

Quentin

maintainer
#2 lore raw
Quoted 17 lines · Quentin Monnet

2023-01-25 08:25 UTC+0530 ~ Chethan Suresh <[email protected]>

Quoted 16 lines

We've experienced similar issues about bpfilter like below:
https://github.com/moby/moby/issues/43755
https://lore.kernel.org/bpf/CAADnVQJ5MxGkq=ng214aYoH-NmZ1gjoS=ZTY1eU-Fag4RwZjdg@mail.gmail.com/

Considering the current development status of bpfilter, disable bpfilter kernel config checks in bpftool feature. For production system, we should disable both CONFIG_BPFILTER and CONFIG_BPFILTER_UMH for now. Or can be enabled as some tools depend on bpfilter.

---
  tools/bpf/bpftool/feature.c | 4 ----
  1 file changed, 4 deletions(-)
Quoted 12 lines

tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 432

Quoted 12 lines
tools/bpf/bpftool/feature.c +0 -4
index 36cf0f1517c9..c6087bbc6613 100644
@@ -426,10 +426,6 @@ static void probe_kernel_image_config(const char *define_prefix)
  		{ "CONFIG_BPF_STREAM_PARSER", },
  		/* xt_bpf module for passing BPF programs to netfilter  */
  		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
-		/* bpfilter back-end for iptables */
-		{ "CONFIG_BPFILTER", },
-		/* bpftilter module with "user mode helper" */
-		{ "CONFIG_BPFILTER_UMH", },

Right, for bpftool this change is rather moot. Maybe until the work from QuentinD materializes, the BPFILTER should just be built with depends on COMPILE_TEST so that this doesn't negatively affect users as reported in above links.

Quoted 11 lines

tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 431

Quoted 3 lines
tools/bpf/bpftool/feature.c +0 -0
  		/* test_bpf module for BPF tests */
  		{ "CONFIG_TEST_BPF", },

Hi,
I don't understand. The feature probe simply looks for the kconfig option in the kconfig file. What are you hoping to achieve by removing this check? How is it going to help with your issues?

Quentin

#3 lore raw
In reply to Chethan Suresh
Quoted 34 lines · Chethan Suresh

We've experienced similar issues about bpfilter like below:
https://github.com/moby/moby/issues/43755
https://lore.kernel.org/bpf/CAADnVQJ5MxGkq=ng214aYoH-NmZ1gjoS=ZTY1eU-Fag4RwZjdg@mail.gmail.com/

Considering the current development status of bpfilter, disable bpfilter kernel config checks in bpftool feature. For production system, we should disable both CONFIG_BPFILTER and CONFIG_BPFILTER_UMH for now. Or can be enabled as some tools depend on bpfilter.

---
 tools/bpf/bpftool/feature.c | 4 ----
 1 file changed, 4 deletions(-)
tools/bpf/bpftool/feature.c +0 -4
index 36cf0f1517c9..c6087bbc6613 100644
@@ -426,10 +426,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		{ "CONFIG_BPF_STREAM_PARSER", },
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
-		/* bpfilter back-end for iptables */
-		{ "CONFIG_BPFILTER", },
-		/* bpftilter module with "user mode helper" */
-		{ "CONFIG_BPFILTER_UMH", },
 
 		/* test_bpf module for BPF tests */
 		{ "CONFIG_TEST_BPF", },
Signature · 1 line
2.17.1

While I don't think this check is effectively needed in bpftool regarding bpfilter's current state, I don't see how it's related to the issues you're linking.

The GitHub issue you're linking is due to CONFIG_BPFILTER being enabled on a kernel, with no related to bpftool.

Regards,
Quentin

#4 lore raw
In reply to Chethan Suresh
Quoted 2 lines · Chethan Suresh

We've experienced similar issues about bpfilter like below:
https://github.com/moby/moby/issues/43755

I've been looking into this issue a bit more, it seems the author has CONFIG_BPFILTER enabled, which shouldn't be. I've answered to the thread to clarify the situation.

Regarding why CONFIG_BPFILTER was enabled, it seems linuxkit [1] project's default configurations for multiple kernel verisons had it enabled, for some reason. This was fixed [2] a few month ago for *some* of the configurations, I've published a PR [3] for the remaining configuration.
It's been approved but not merged yet. It's unclear why those configurations had CONFIG_BPFILTER enabled in the first place, but it's definitely a mistake.

[1]: https://github.com/linuxkit/linuxkit
[2]: https://github.com/linuxkit/linuxkit/pull/3701
[3]: https://github.com/linuxkit/linuxkit/pull/3904

Quoted 19 lines

https://lore.kernel.org/bpf/CAADnVQJ5MxGkq=ng214aYoH-NmZ1gjoS=ZTY1eU-Fag4RwZjdg@mail.gmail.com/

Considering the current development status of bpfilter, disable bpfilter kernel config checks in bpftool feature. For production system, we should disable both CONFIG_BPFILTER and CONFIG_BPFILTER_UMH for now. Or can be enabled as some tools depend on bpfilter.

---
 tools/bpf/bpftool/feature.c | 4 ----
 1 file changed, 4 deletions(-)
tools/bpf/bpftool/feature.c +0 -0
index 36cf0f1517c9..c6087bbc6613 100644

tools/bpf/bpftool/feature.c static void probe_kernel_image_config(const char *define_prefix) · line 431

Quoted 10 lines
tools/bpf/bpftool/feature.c +0 -4
@@ -426,10 +426,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		{ "CONFIG_BPF_STREAM_PARSER", },
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
-		/* bpfilter back-end for iptables */
-		{ "CONFIG_BPFILTER", },
-		/* bpftilter module with "user mode helper" */
-		{ "CONFIG_BPFILTER_UMH", },
 
 		/* test_bpf module for BPF tests */
 		{ "CONFIG_TEST_BPF", },

Regards,
Quentin