]> www.infradead.org Git - users/dwmw2/linux.git/commit
netfilter: ebtables: also count base chain policies
authorFlorian Westphal <fw@strlen.de>
Mon, 29 Jul 2019 15:58:10 +0000 (17:58 +0200)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:23 +0000 (10:10 -0400)
commit48e73abb96864f838a1a53d594b8617f161369aa
treeef3851d4f2076af9693a1e0b9f2a57c92252b954
parent27843db1180c7144393b9b2c182c081631a1a20a
netfilter: ebtables: also count base chain policies

commit 3b48300d5cc7c7bed63fddb006c4046549ed4aec upstream.

ebtables doesn't include the base chain policies in the rule count,
so we need to add them manually when we call into the x_tables core
to allocate space for the comapt offset table.

This lead syzbot to trigger:
WARNING: CPU: 1 PID: 9012 at net/netfilter/x_tables.c:649
xt_compat_add_offset.cold+0x11/0x36 net/netfilter/x_tables.c:649

Reported-by: syzbot+276ddebab3382bbf72db@syzkaller.appspotmail.com
Fixes: 2035f3ff8eaa ("netfilter: ebtables: compat: un-break 32bit setsockopt when no rules are present")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/netfilter/ebtables.c