sparc64 ipv6 ip6tables nogo
Subsystems (2)
Hi,
i seem to have been hit by a ip6tables problem on sparc64 - It seems that there are some hidden 64bit kernel / 32 bit userspace problems somewhere in netfilter (Same happened with tunnel ioctls on sparc64)
Setup:
tracepath:~# uname -a Linux tracepath 2.4.19 #1 Thu Aug 8 15:05:32 CEST 2002 sparc64 unknown tracepath:~# egrep "^CONFIG_IPV*6" /boot/config-2.4.19 CONFIG_IPV6=y CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m tracepath:~# lsmod Module Size Used by Not tainted ip6_tables 14272 0 iptable_filter 2040 1 (autoclean) ip_tables 13952 1 [iptable_filter] sunhme 25256 1 (autoclean) tracepath:~# ip6tables -L ip6tables v1.2.6a: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded. tracepath:~# modprobe ip6table_filter /lib/modules/2.4.19/kernel/net/ipv6/netfilter/ip6table_filter.o: init_module: Invalid argument Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.19/kernel/net/ipv6/netfilter/ip6table_filter.o: insmod /lib/modules/2.4.19/kernel/net/ipv6/netfilter/ip6table_filter.o failed /lib/modules/2.4.19/kernel/net/ipv6/netfilter/ip6table_filter.o: insmod ip6table_filter failed tracepath:~# iptables -v iptables v1.2.6a: no command specified Try `iptables -h' or 'iptables --help' for more information.
Same happens with iptables 1.2.7 - Distribution is a Debian/Woody on an Ultrasparc 5 with a 2.4.19 (vanilla) kernel.
Flo
PS: I am not subscribed to netfilter-devel
Signature · 2 lines
Florian Lohoff [email protected] +49-5201-669912 Heisenberg may have been here.
Quoted 5 lines · Florian Lohoff
Hi,
i seem to have been hit by a ip6tables problem on sparc64 - It seems that there are some hidden 64bit kernel / 32 bit userspace problems somewhere in netfilter (Same happened with tunnel ioctls on sparc64)
There are known 64bit kernel/ 32bit userspace problems, which affect the byte/packet counters in iptables/ip6tables. I've tried to fix this, but unfortunately didn't succeed. See the mailinglist archives for this.
The ip6tables problem you have reported was unknown so far. I can reproduce this problem on my Ultra5 running 2.4.18. But it certainly has no relation to any 64/32 kernel/usrspace, since there is no userspace involved when ip6table_filter registers with ip6_tables.
What really is surprising is the fact that ip_tables work and ip6_tables doesn't - and ip6_tables is a copy+paste 'port'...
I've tried to debug the problem, and the EINVAL comes from check_entry_size_and_hooks() in ip6_tables.c:
translate_table: size 856
Bad offset 000000014002e074
Unfortunately I don't have the time to dig further right now. I will put it on the TODO list.
Quoted 2 lines
Flo
PS: I am not subscribed to netfilter-devel
Signature · 5 lines
Live long and prosper - Harald Welte / [email protected] http://www.gnumonks.org/ ============================================================================ GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M+ V-- PS++ PE-- Y++ PGP++ t+ 5-- !X !R tv-- b+++ !DI !D G+ e* h--- r++ y+(*)
Hi,
(I send the patch to the Netfilter-Devel list, too. I forgot it :()
Quoted 3 lines
i seem to have been hit by a ip6tables problem on sparc64 - It seems that there are some hidden 64bit kernel / 32 bit userspace problems somewhere in netfilter (Same happened with tunnel ioctls on sparc64)
One quick workaround is attached for this problem. (The counter-problem remained)
Thanks to: Florian Lohoff <[email protected]>
Regards,
kisza
Signature · 3 lines
Andras Kis-Szabo Security Development, Design and Audit -------------------------/ Zorp, NetFilter and IPv6 [email protected] /------------------------------------------->
net/ipv6/netfilter/ip6_tables.c renamed from net/ipv6/netfilter/ip6_tables.c.as +2 -4
@@ -101,10 +101,8 @@unsigned int hook_entry[NF_IP6_NUMHOOKS ];unsigned int underflow[NF_IP6_NUMHOOKS ]; -char padding[SMP_ALIGN ((NF_IP6_NUMHOOKS *2 +2 )*sizeof (unsigned int ))]; -/* ip6t_entry tables: one per CPU */ -char entries[0 ]; +char entries[0 ]____cacheline_aligned ; };static LIST_HEAD (ip6t_target);
@@ -1449,7 +1447,7 @@int ret;struct ip6t_table_info *newinfo;static struct ip6t_table_info bootstrap - = {0 ,0 ,0 , {0 }, {0 }, { }, { } }; + = {0 ,0 ,0 , {0 }, {0 }, { } };MOD_INC_USE_COUNT ; newinfo = vmalloc(sizeof(struct ip6t_table_info)