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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cxh2piVufTWbzKTmUafTkk
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
92d601f585
commit
35f3ca10eb
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user