]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: arptables: use pernet ops struct during unregister
authorFlorian Westphal <fw@strlen.de>
Mon, 3 May 2021 11:51:15 +0000 (13:51 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 3 May 2021 21:04:01 +0000 (23:04 +0200)
commit2b5452fcdd3b8ea249fa1bfef51a65b29dd5e549
treeeb9028ed20c69945c239e7a69c00eee0974acebb
parent763066ec23356d09156c96fc902e59c358818f7b
netfilter: arptables: use pernet ops struct during unregister

Like with iptables and ebtables, hook unregistration has to use the
pernet ops struct, not the template.

This triggered following splat:
  hook not found, pf 3 num 0
  WARNING: CPU: 0 PID: 224 at net/netfilter/core.c:480 __nf_unregister_net_hook+0x1eb/0x610 net/netfilter/core.c:480
[..]
 nf_unregister_net_hook net/netfilter/core.c:502 [inline]
 nf_unregister_net_hooks+0x117/0x160 net/netfilter/core.c:576
 arpt_unregister_table_pre_exit+0x67/0x80 net/ipv4/netfilter/arp_tables.c:1565

Fixes: 221427648526d ("netfilter: arp_tables: pass table pointer via nf_hook_ops")
Reported-by: syzbot+dcccba8a1e41a38cb9df@syzkaller.appspotmail.com
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/linux/netfilter_arp/arp_tables.h
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arptable_filter.c