netfilter: arp_tables: fix invoking 32bit "iptable -P INPUT ACCEPT" failed in 64bit...
authorHongxu Jia <hongxu.jia@windriver.com>
Wed, 30 Nov 2016 02:56:26 +0000 (21:56 -0500)
committerJiri Slaby <jslaby@suse.cz>
Tue, 9 May 2017 06:19:43 +0000 (08:19 +0200)
commit36c65fa1834ed4bc54497a4ffae65058b6c6bb63
tree45e8f2da039edc3e5cc04914e25bb9a05fb2078b
parent915ff058627e270b93b3d398b4b0f2c42d27a362
netfilter: arp_tables: fix invoking 32bit "iptable -P INPUT ACCEPT" failed in 64bit kernel

commit 17a49cd549d9dc8707dc9262210166455c612dde upstream.

Since 09d9686047db ("netfilter: x_tables: do compat validation via
translate_table"), it used compatr structure to assign newinfo
structure.  In translate_compat_table of ip_tables.c and ip6_tables.c,
it used compatr->hook_entry to replace info->hook_entry and
compatr->underflow to replace info->underflow, but not do the same
replacement in arp_tables.c.

It caused invoking 32-bit "arptbale -P INPUT ACCEPT" failed in 64bit
kernel.
--------------------------------------
root@qemux86-64:~# arptables -P INPUT ACCEPT
root@qemux86-64:~# arptables -P INPUT ACCEPT
ERROR: Policy for `INPUT' offset 448 != underflow 0
arptables: Incompatible with this kernel
--------------------------------------

Fixes: 09d9686047db ("netfilter: x_tables: do compat validation via translate_table")
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/ipv4/netfilter/arp_tables.c