From 35f3ca10eb68462d1c7668312133fef039bece52 Mon Sep 17 00:00:00 2001 From: Noah Date: Wed, 7 Oct 2026 13:16:08 -0600 Subject: [PATCH 1/2] kernel: build in IPv6 netfilter (flare-edge#533) The panel kernel had no ip6tables filter table, so the IPv4 default-drop firewall never applied to IPv6 and dropbear and telnetd were reachable over ::. Enable the ip6tables core (legacy flavour, matching the userland), the filter table, and IPv6 defrag for conntrack, all built in because the panel has no /lib/modules: CONFIG_NF_DEFRAG_IPV6=y CONFIG_IP6_NF_IPTABLES=y CONFIG_IP6_NF_IPTABLES_LEGACY=y CONFIG_IP6_NF_FILTER=y No new match symbols: icmp6 lives in xt_tcpudp, and state, limit and conntrack are family-agnostic and already enabled. build-kernel.sh now asserts these four are =y in the final .config, because olddefconfig drops an unmet-dependency line silently and the loss would only show as an unfiltered IPv6 stack in the field. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Cxh2piVufTWbzKTmUafTkk --- build/build-kernel.sh | 16 ++++++++++++++++ build/warden_defconfig | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/build/build-kernel.sh b/build/build-kernel.sh index 0b62b15..ae3d056 100755 --- a/build/build-kernel.sh +++ b/build/build-kernel.sh @@ -121,6 +121,22 @@ command -v "${CROSS_COMPILE}gcc" >/dev/null \ || { echo "cross toolchain ${CROSS_COMPILE}gcc not on PATH (set SDK_TC, or CROSS_COMPILE to one that is)" >&2; exit 1; } make -C "$SRC" ARCH=arm CROSS_COMPILE="$CROSS_COMPILE" olddefconfig >/dev/null +# Took-effect assertion for the symbols whose silent loss is a security hole, +# not a build failure. olddefconfig drops a defconfig line whose dependencies +# are unmet without a word, and the panel's firewall then quietly stops +# covering IPv6 (flare-edge#533: no ip6tables filter table, so the IPv4 +# default-drop never applied to IPv6). Every symbol here must be built in +# (=y): the panel has no /lib/modules. +req_fail=0 +for sym in CONFIG_NF_DEFRAG_IPV6 CONFIG_IP6_NF_IPTABLES \ + CONFIG_IP6_NF_IPTABLES_LEGACY CONFIG_IP6_NF_FILTER; do + grep -qxF "$sym=y" "$SRC/.config" || { + echo "FATAL: required option $sym is not =y in the final .config (unmet Kconfig dependency?)" >&2 + req_fail=1 + } +done +[ "$req_fail" = 0 ] || exit 1 + # Fragment took-effect assertion: merge_config -m only pastes text, and # olddefconfig silently resolves any symbol whose dependencies are unmet: # a fragment option could be dropped without a word. Verify every explicit diff --git a/build/warden_defconfig b/build/warden_defconfig index a503227..2f2ad66 100644 --- a/build/warden_defconfig +++ b/build/warden_defconfig @@ -1372,3 +1372,24 @@ CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_MANGLE=y +# +# IPv6 netfilter (flare-edge#533). Without it ip6tables has no filter table +# ("Table does not exist"), so the IPv4 default-drop INPUT policy in +# S35iptables never applied to IPv6 and every listener bound to :: (dropbear, +# telnetd, the web UI) was reachable over IPv6. Four symbols, all built in +# because the panel has no /lib/modules: +# IP6_NF_IPTABLES + IP6_NF_IPTABLES_LEGACY the ip6tables core, legacy +# flavour (the userland is legacy) +# IP6_NF_FILTER the filter table; it defaults to +# =m under legacy, so =y is explicit +# NF_DEFRAG_IPV6 IPv6 reassembly for conntrack, so +# the state/conntrack matches work +# (NF_CONNTRACK selects it when +# IPV6 is on; listed so the set is +# visible and guarded) +# No new match symbols: the icmp6 match lives in xt_tcpudp, and state, limit +# and conntrack are the family-agnostic matches enabled above. +CONFIG_NF_DEFRAG_IPV6=y +CONFIG_IP6_NF_IPTABLES=y +CONFIG_IP6_NF_IPTABLES_LEGACY=y +CONFIG_IP6_NF_FILTER=y From b7125fc4a71c6859abd9e9be4bfccd5779ee3592 Mon Sep 17 00:00:00 2001 From: Noah Date: Wed, 7 Oct 2026 14:35:09 -0600 Subject: [PATCH 2/2] kernel: correct IPv6 netfilter defconfig comment (flare-edge#533) The icmp6 match is part of the ip6_tables core (IP6_NF_IPTABLES), not xt_tcpudp. Comment only; the symbol set is unchanged. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01Cxh2piVufTWbzKTmUafTkk --- build/warden_defconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/warden_defconfig b/build/warden_defconfig index 2f2ad66..134eb26 100644 --- a/build/warden_defconfig +++ b/build/warden_defconfig @@ -1387,8 +1387,10 @@ CONFIG_IP_NF_MANGLE=y # (NF_CONNTRACK selects it when # IPV6 is on; listed so the set is # visible and guarded) -# No new match symbols: the icmp6 match lives in xt_tcpudp, and state, limit -# and conntrack are the family-agnostic matches enabled above. +# No new match symbols: the icmp6 match is part of the ip6_tables core +# (IP6_NF_IPTABLES); tcp/udp matches are in xt_tcpudp, always built with +# XTABLES; state, limit and conntrack are the family-agnostic matches enabled +# above. CONFIG_NF_DEFRAG_IPV6=y CONFIG_IP6_NF_IPTABLES=y CONFIG_IP6_NF_IPTABLES_LEGACY=y