Thread View: linux.debian.bugs.dist
6 messages
6 total messages
Started by David Härdeman
Wed, 07 Oct 2026 11:20
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: David Härdeman
Date: Wed, 07 Oct 2026 11:20
Date: Wed, 07 Oct 2026 11:20
20 lines
3150 bytes
3150 bytes
On 9/25/26 13:33, Marc Haber wrote: > On Fri, Sep 25, 2026 at 09:27:58AM +0200, David Härdeman wrote: >> I did a quick and dirty test by downloading only >> debian/ferm-early.conf from that branch and putting it in >> /etc/ferm/ferm-early.conf (also removed my local modifications) >> followed by a reboot. It seems to work as expected (DHCPv6 lease >> obtained quickly, boot wasn't delayed). > > Are you already running a reasonably late ferm version that allows you > to run with debugging enabled? I would be interested in exactly how > the early ruleset looks on your system with the patch. Yeah, I'm running Debian Unstable (ferm 2.7-9) on the system where I did the testing, and I already added some custom systemd .service files to tcpdump the traffic to diagnose the initial issue, so further debugging output should be easy to provide. Which steps do you want me to take/which debugging info do you want? Cheers, David
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: Marc Haber
Date: Sun, 25 Oct 2026 18:20
Date: Sun, 25 Oct 2026 18:20
22 lines
3508 bytes
3508 bytes
Hi David, On Wed, Oct 07, 2026 at 01:13:48PM +0200, David Härdeman wrote: > Yeah, I'm running Debian Unstable (ferm 2.7-9) on the system where I did the > testing, and I already added some custom systemd .service files to tcpdump > the traffic to diagnose the initial issue, so further debugging output > should be easy to provide. Which steps do you want me to take/which > debugging info do you want? Thank you very much for your patience. I apologize for not getting back to you any earlier, I was busy with private life in October. If you are still having issues with the current state of the package, you can enable the debugging code in ferm-systemd by setting DEBUGLOG_DIR to some persistent directory in both systemd service units and rebooting. The directory should then be filled with dump files showing the state of packet filtering when ferm-systemd is invoked. Maybe that'll help. Feel free to tar up the contents of that directory and e-mail it privately to me. Greetings Marc
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: David Härdeman
Date: Wed, 18 Nov 2026 00:00
Date: Wed, 18 Nov 2026 00:00
50 lines
4497 bytes
4497 bytes
On Sun, Oct 25, 2026 at 05:29:31PM +0100, Marc Haber wrote:
>On Wed, Oct 07, 2026 at 01:13:48PM +0200, David Härdeman wrote:
>> Yeah, I'm running Debian Unstable (ferm 2.7-9) on the system where I did the
>> testing, and I already added some custom systemd .service files to tcpdump
>> the traffic to diagnose the initial issue, so further debugging output
>> should be easy to provide. Which steps do you want me to take/which
>> debugging info do you want?
>
>Thank you very much for your patience. I apologize for not getting back
>to you any earlier, I was busy with private life in October.
No problem, I've also been busy...
>If you are still having issues with the current state of the package,
>you can enable the debugging code in ferm-systemd by setting
>DEBUGLOG_DIR to some persistent directory in both systemd service units
>and rebooting.
Actually, I'm not having any issues (after I copied ferm-early.conf from
your branch)...
*However*, my quick and dirty test was perhaps a bit too quick and
dirty. I just copied one file from your zg/icmpv6 branch
(debian/ferm-early.conf). I've tried the whole thing now and there's two
issue.
First, there's a typo in debian/ferm.conf; line 50 adds a superfluous "}".
Second, in debian/ferm-early.conf, every "interface + @subchain INPUT-early { ... }"
adds two rules, a jump in INPUT to INPUT-early and then the actual rule(s) in
INPUT-early. That results in duplicated jumps in INPUT (can be seen
with "ferm --noexec --lines"), e.g.:
-A INPUT --in-interface + --jump INPUT-early
-A INPUT --in-interface + --jump INPUT-early
I'd suggest you change the last two "domain(X)" parts to:
domain ip table filter chain INPUT-early {
# allow all ICMP
...
}
domain ip6 table filter chain INPUT-early {
# allow all ICMPv6
...
}
--
David Härdeman
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: Marc Haber
Date: Wed, 18 Nov 2026 17:30
Date: Wed, 18 Nov 2026 17:30
38 lines
4230 bytes
4230 bytes
On Wed, Nov 18, 2026 at 12:47:16AM +0100, David Härdeman wrote:
> *However*, my quick and dirty test was perhaps a bit too quick and
> dirty. I just copied one file from your zg/icmpv6 branch
> (debian/ferm-early.conf). I've tried the whole thing now and there's two
> issue.
>
> First, there's a typo in debian/ferm.conf; line 50 adds a superfluous "}".
Ouch, bad mistake. I'm going to write an autopkgtest that finds that.
There are chances that this test already exists and I was just oo stupid
to run it.
> Second, in debian/ferm-early.conf, every "interface + @subchain INPUT-early { ... }"
> adds two rules, a jump in INPUT to INPUT-early and then the actual rule(s) in
> INPUT-early. That results in duplicated jumps in INPUT (can be seen
> with "ferm --noexec --lines"), e.g.:
>
> -A INPUT --in-interface + --jump INPUT-early
> -A INPUT --in-interface + --jump INPUT-early
I consider that a bug in ferm and will draft a patch that makes
multiple @subchain commands idempotent. Otherwise, a change in the
dual-stack part of the rule will probably cause a corollary error in one
of the single-stack stanzas and I'd like to avoid that - especially when
this happens in more complex rule sets where the two instances of
@subchain foo might be in entirely different parts of the rule set.
The use case of two identically named but differnt subchains is
possible, but was unsupported before. Would you like to have ferm issue
a warning in this case or not?
Having a warning for two @subchain foo statements will expose unwanted
behavior if the doubled use of the subchain was unintended, but it will
generate a warning if the identically named subchain was actually
intended to be the same chain. Warning or not?
Greetings
Marc
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: David Härdeman
Date: Wed, 18 Nov 2026 23:40
Date: Wed, 18 Nov 2026 23:40
85 lines
6170 bytes
6170 bytes
On Wed, Nov 18, 2026 at 06:20:40PM +0100, Marc Haber wrote:
>On Wed, Nov 18, 2026 at 12:47:16AM +0100, David Härdeman wrote:
>> First, there's a typo in debian/ferm.conf; line 50 adds a superfluous "}".
>
>Ouch, bad mistake. I'm going to write an autopkgtest that finds that.
>There are chances that this test already exists and I was just oo stupid
>to run it.
First of all, I'm in the middle of another project so I only had a very
quick look...so take this all with an appropriate grain of salt....
From a quick look, running "ferm --remote" on the shipped ferm.conf and
ferm-early.conf and failing on a non-zero exit code or *any* output on
stderr might be enough as an autopkgtest.
>> Second, in debian/ferm-early.conf, every "interface + @subchain INPUT-early { ... }"
>> adds two rules, a jump in INPUT to INPUT-early and then the actual rule(s) in
>> INPUT-early. That results in duplicated jumps in INPUT (can be seen
>> with "ferm --noexec --lines"), e.g.:
>>
>> -A INPUT --in-interface + --jump INPUT-early
>> -A INPUT --in-interface + --jump INPUT-early
>
>I consider that a bug in ferm and will draft a patch that makes
>multiple @subchain commands idempotent. Otherwise, a change in the
>dual-stack part of the rule will probably cause a corollary error in one
>of the single-stack stanzas and I'd like to avoid that - especially when
>this happens in more complex rule sets where the two instances of
>@subchain foo might be in entirely different parts of the rule set.
I think it might be better not to...imagine things like (pseudocode):
interface X + @subchain A { ALLOW };
...
interface Y + @subchain A { if FOO then BAR };
vs:
interface Y + @subchain A { if FOO then BAR };
...
interface X + @subchain A { ALLOW };
IOW...I think it might be a world of pain....and (given that ferm
upstream seems moribound), you'd have to carry that forever. So
current behaviour + warn seems like the sane thing to do.
>> *However*, my quick and dirty test was perhaps a bit too quick and
>> dirty. I just copied one file from your zg/icmpv6 branch
>> (debian/ferm-early.conf). I've tried the whole thing now and there's two
>> issue.
>>
>
>The use case of two identically named but differnt subchains is
>possible, but was unsupported before. Would you like to have ferm issue
>a warning in this case or not?
>
>Having a warning for two @subchain foo statements will expose unwanted
>behavior if the doubled use of the subchain was unintended, but it will
>generate a warning if the identically named subchain was actually
>intended to be the same chain. Warning or not?
I think a warning is the sane default. What else? Error...for a
firewall, what does "error" mean? Stop loading rules? I think it's
reasonable to just focus on the shipped rules being sane, and then
people have to take responsibility for their own local stuff...
Turning to the rules in the package itself, writing the per-domain parts
as plain "chain INPUT-early" blocks avoids the issue entirely, since
that appends to the chain without adding a jump:
domain ip table filter chain INPUT-early {
# allow all ICMP
proto icmp ACCEPT;
}
domain ip6 table filter chain INPUT-early {
# allow all ICMPv6
proto ipv6-icmp ACCEPT;
# allow DHCPv6
proto udp saddr fe80::/10 sport 547 dport 546 ACCEPT;
}
--
David Härdeman
Bug#1148882: ferm: ferm-early needs support for DHCPv6
Author: Marc Haber
Date: Mon, 23 Nov 2026 20:10
Date: Mon, 23 Nov 2026 20:10
89 lines
6385 bytes
6385 bytes
On Thu, Nov 19, 2026 at 12:28:59AM +0100, David Härdeman wrote:
> On Wed, Nov 18, 2026 at 06:20:40PM +0100, Marc Haber wrote:
> >On Wed, Nov 18, 2026 at 12:47:16AM +0100, David Härdeman wrote:
> >> First, there's a typo in debian/ferm.conf; line 50 adds a superfluous "}".
> >
> >Ouch, bad mistake. I'm going to write an autopkgtest that finds that.
> >There are chances that this test already exists and I was just oo stupid
> >to run it.
No, that test didn't exist, it now does (in a branch).
> >I consider that a bug in ferm and will draft a patch that makes
> >multiple @subchain commands idempotent. Otherwise, a change in the
> >dual-stack part of the rule will probably cause a corollary error in one
> >of the single-stack stanzas and I'd like to avoid that - especially when
> >this happens in more complex rule sets where the two instances of
> >@subchain foo might be in entirely different parts of the rule set.
>
> I think it might be better not to...imagine things like (pseudocode):
>
> interface X + @subchain A { ALLOW };
> ...
> interface Y + @subchain A { if FOO then BAR };
>
> vs:
>
> interface Y + @subchain A { if FOO then BAR };
> ...
> interface X + @subchain A { ALLOW };
>
> IOW...I think it might be a world of pain....and (given that ferm
> upstream seems moribound), you'd have to carry that forever. So
> current behaviour + warn seems like the sane thing to do.
I think you're right, but this is just a decision between wrong and
wrong.
> >> *However*, my quick and dirty test was perhaps a bit too quick and
> >> dirty. I just copied one file from your zg/icmpv6 branch
> >> (debian/ferm-early.conf). I've tried the whole thing now and there's two
> >> issue.
> >>
> >
> >The use case of two identically named but differnt subchains is
> >possible, but was unsupported before. Would you like to have ferm issue
> >a warning in this case or not?
> >
> >Having a warning for two @subchain foo statements will expose unwanted
> >behavior if the doubled use of the subchain was unintended, but it will
> >generate a warning if the identically named subchain was actually
> >intended to be the same chain. Warning or not?
>
> I think a warning is the sane default. What else? Error...for a
> firewall, what does "error" mean? Stop loading rules? I think it's
> reasonable to just focus on the shipped rules being sane, and then
> people have to take responsibility for their own local stuff...
Just continue as far as it is possible. Erroring out is a good thing for
rebuilding an existing rule set (in which case the old rule set stays
active), but for initialization that is bad. But otoh we have an easy
and hopefully quite static early rule set, that can stay in place if
building the "real" rule set fails, and if the early rule set errors out
I personally make sure on my machine that it stays without packet filter
but also without routing function and with only sshd running.
> Turning to the rules in the package itself, writing the per-domain parts
> as plain "chain INPUT-early" blocks avoids the issue entirely, since
> that appends to the chain without adding a jump:
>
> domain ip table filter chain INPUT-early {
> # allow all ICMP
> proto icmp ACCEPT;
> }
>
> domain ip6 table filter chain INPUT-early {
> # allow all ICMPv6
> proto ipv6-icmp ACCEPT;
>
> # allow DHCPv6
> proto udp saddr fe80::/10 sport 547 dport 546 ACCEPT;
> }
That triggers warnings as well. And I am not particularly fond of having
just another ordering issue in the rule set. Otoh, we're putting gold
plating on a package I originally intended to barely keep alive untli I
am ready to migrate to nft+wrapper myself.
Greetings
Marc
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads