diff mbox series

[nf-next,v4,1/2] netfilter: Make IP6_NF_IPTABLES_LEGACY selectable

Message ID 20240829161656.832208-2-leitao@debian.org (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series netfilter: Make IP_NF_IPTABLES_LEGACY selectable | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 17 this patch: 17
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 22 this patch: 22
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-30--18-00 (tests: 713)

Commit Message

Breno Leitao Aug. 29, 2024, 4:16 p.m. UTC
This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
users the option to configure iptables without enabling any other
config.

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 net/ipv6/netfilter/Kconfig | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Florian Westphal Aug. 29, 2024, 4:25 p.m. UTC | #1
Breno Leitao <leitao@debian.org> wrote:
> This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
> users the option to configure iptables without enabling any other
> config.

I don't get it.

IP(6)_NF_IPTABLES_LEGACY without iptable_filter, mangle etc.
is useless, rules get attached to basechains that get registered
by the iptable_{mangle,filter,nat,...} modules, i.e. those that
"select IP(6)_NF_IPTABLES_LEGACY".

The old get/setsockopt UAPI is useless without them, iptables -L, -A,
etc. won't work.

What am I missing?

I'm fine with this because this is needed anyway to allow
disabling the get/setsockopt api (needs the 'depends on' changes
though) later, but this change is a mystery to me.
Breno Leitao Aug. 30, 2024, 12:45 p.m. UTC | #2
Hello Florian,

On Thu, Aug 29, 2024 at 06:25:12PM +0200, Florian Westphal wrote:
> Breno Leitao <leitao@debian.org> wrote:
> > This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
> > users the option to configure iptables without enabling any other
> > config.
> 
> I don't get it.
> 
> IP(6)_NF_IPTABLES_LEGACY without iptable_filter, mangle etc.
> is useless,

Correct. We need to have iptable_filter, mangle, etc available.

I would like to have ip6_tables as built-in
(IP(6)_NF_IPTABLES_LEGACY=y), all the other tables built as modules.

So, I am used to a configure similar to the following (before
a9525c7f6219c ("netfilter: xtables: allow xtables-nft only builds"))

	CONFIG_IP6_NF_IPTABLES=y
	CONFIG_IP6_NF_MANGLE=m
	CONFIG_IP6_NF_RAW=m
	...

After a9525c7f6219c ("netfilter: xtables: allow xtables-nft only
builds"), the same configuration is not possible anymore, because 
CONFIG_IP6_NF_IPTABLES is not user selectable anymore, thus, in order to
set it as built-in (=y), I need to set the tables as =y.

Sorry for not being clear before, and thanks for reviewing it.
--breno
Florian Westphal Aug. 30, 2024, 1:13 p.m. UTC | #3
Breno Leitao <leitao@debian.org> wrote:
> Hello Florian,
> 
> On Thu, Aug 29, 2024 at 06:25:12PM +0200, Florian Westphal wrote:
> > Breno Leitao <leitao@debian.org> wrote:
> > > This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
> > > users the option to configure iptables without enabling any other
> > > config.
> > 
> > I don't get it.
> > 
> > IP(6)_NF_IPTABLES_LEGACY without iptable_filter, mangle etc.
> > is useless,
> 
> Correct. We need to have iptable_filter, mangle, etc available.
> 
> I would like to have ip6_tables as built-in
> (IP(6)_NF_IPTABLES_LEGACY=y), all the other tables built as modules.
> 
> So, I am used to a configure similar to the following (before
> a9525c7f6219c ("netfilter: xtables: allow xtables-nft only builds"))
> 
> 	CONFIG_IP6_NF_IPTABLES=y
> 	CONFIG_IP6_NF_MANGLE=m
> 	CONFIG_IP6_NF_RAW=m
> 	...
> 
> After a9525c7f6219c ("netfilter: xtables: allow xtables-nft only
> builds"), the same configuration is not possible anymore, because 
> CONFIG_IP6_NF_IPTABLES is not user selectable anymore, thus, in order to
> set it as built-in (=y), I need to set the tables as =y.

Good, I was worried  there was a functional regression here, but
this is more "matter of taste" then.

I thunk patch is fine, I will try to add the relevant
depends-on change some time in the near future.
Breno Leitao Aug. 30, 2024, 2:04 p.m. UTC | #4
Hello Florian,

On Fri, Aug 30, 2024 at 03:13:01PM +0200, Florian Westphal wrote:
> > After a9525c7f6219c ("netfilter: xtables: allow xtables-nft only
> > builds"), the same configuration is not possible anymore, because 
> > CONFIG_IP6_NF_IPTABLES is not user selectable anymore, thus, in order to
> > set it as built-in (=y), I need to set the tables as =y.
> 
> Good, I was worried  there was a functional regression here, but
> this is more "matter of taste" then.
> 
> I thunk patch is fine, I will try to add the relevant
> depends-on change some time in the near future.

I am more than happy to do it, if you wish. I just want to decouple both
changes from each other.
Florian Westphal Aug. 30, 2024, 2:09 p.m. UTC | #5
Breno Leitao <leitao@debian.org> wrote:
> > I thunk patch is fine, I will try to add the relevant
> > depends-on change some time in the near future.
> 
> I am more than happy to do it, if you wish. I just want to decouple both
> changes from each other.

Ah, that makes sense to me.

The "depends" change would be good to have, see
https://lore.kernel.org/netfilter-devel/20240813183202.GA13864@breakpoint.cc/

(TL;DR: PREEMPT_RT requirements would need more surgery in old
 x_tables infra)
Pablo Neira Ayuso Sept. 5, 2024, 11:01 p.m. UTC | #6
Hi,

On Thu, Aug 29, 2024 at 09:16:54AM -0700, Breno Leitao wrote:
> This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
> users the option to configure iptables without enabling any other
> config.

IUC this is to allow to compile iptables core built-in while allowing
extensions to be compiled as module? What is exactly the combination
you are trying to achieve which is not possible with the current
toggle?

Florian's motivation to add this knob is to allow to compile kernels
without iptables-legacy support.

One more comment below.

> Signed-off-by: Breno Leitao <leitao@debian.org>
> ---
>  net/ipv6/netfilter/Kconfig | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
> index f3c8e2d918e1..cbe88cc5b897 100644
> --- a/net/ipv6/netfilter/Kconfig
> +++ b/net/ipv6/netfilter/Kconfig
> @@ -8,7 +8,13 @@ menu "IPv6: Netfilter Configuration"
>  
>  # old sockopt interface and eval loop
>  config IP6_NF_IPTABLES_LEGACY
> -	tristate
> +	tristate "Legacy IP6 tables support"
> +	depends on INET && IPV6
> +	select NETFILTER_XTABLES
> +	default n
> +	help
> +	  ip6tables is a general, extensible packet identification legacy framework.

"packet classification" is generally the more appropriate and widely
used term for firewalls.

Maybe simply reword this description to ...

	  ip6tables is a legacy packet classification.

> +	  This is not needed if you are using iptables over nftables (iptables-nft).
>  
>  config NF_SOCKET_IPV6
>  	tristate "IPv6 socket lookup support"
> -- 
> 2.43.5
>
Breno Leitao Sept. 9, 2024, 8:29 a.m. UTC | #7
Hello Pablom

On Fri, Sep 06, 2024 at 01:01:46AM +0200, Pablo Neira Ayuso wrote:
> On Thu, Aug 29, 2024 at 09:16:54AM -0700, Breno Leitao wrote:
> > This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving
> > users the option to configure iptables without enabling any other
> > config.
> 
> IUC this is to allow to compile iptables core built-in while allowing
> extensions to be compiled as module? What is exactly the combination
> you are trying to achieve which is not possible with the current
> toggle?

Correct. iptable core is built-in, and any extension is a module.

> Florian's motivation to add this knob is to allow to compile kernels
> without iptables-legacy support.

Correct, and this continue to be an option. This change only introduces
you the option to set the core as built-in or module, independent of the
extensions.

> > Signed-off-by: Breno Leitao <leitao@debian.org>
> > ---
> >  net/ipv6/netfilter/Kconfig | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
> > index f3c8e2d918e1..cbe88cc5b897 100644
> > --- a/net/ipv6/netfilter/Kconfig
> > +++ b/net/ipv6/netfilter/Kconfig
> > @@ -8,7 +8,13 @@ menu "IPv6: Netfilter Configuration"
> >  
> >  # old sockopt interface and eval loop
> >  config IP6_NF_IPTABLES_LEGACY
> > -	tristate
> > +	tristate "Legacy IP6 tables support"
> > +	depends on INET && IPV6
> > +	select NETFILTER_XTABLES
> > +	default n
> > +	help
> > +	  ip6tables is a general, extensible packet identification legacy framework.
> 
> "packet classification" is generally the more appropriate and widely
> used term for firewalls.
> 
> Maybe simply reword this description to ...
> 
> 	  ip6tables is a legacy packet classification.

Sure, I will send an updated version with this change.

Thanks!
diff mbox series

Patch

diff --git a/net/ipv6/netfilter/Kconfig b/net/ipv6/netfilter/Kconfig
index f3c8e2d918e1..cbe88cc5b897 100644
--- a/net/ipv6/netfilter/Kconfig
+++ b/net/ipv6/netfilter/Kconfig
@@ -8,7 +8,13 @@  menu "IPv6: Netfilter Configuration"
 
 # old sockopt interface and eval loop
 config IP6_NF_IPTABLES_LEGACY
-	tristate
+	tristate "Legacy IP6 tables support"
+	depends on INET && IPV6
+	select NETFILTER_XTABLES
+	default n
+	help
+	  ip6tables is a general, extensible packet identification legacy framework.
+	  This is not needed if you are using iptables over nftables (iptables-nft).
 
 config NF_SOCKET_IPV6
 	tristate "IPv6 socket lookup support"