]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
netfilter: ebtables: reject non-bridge targets
authorFlorian Westphal <fw@strlen.de>
Wed, 6 Jun 2018 10:14:56 +0000 (12:14 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
commit88074586c53037aac6c243658b6fe2848911031f
tree5449a5754581c468b2b55c8857baf47e871425cd
parent4da75b3e76797e1b83307ad5c1fe4d6757eb82bd
netfilter: ebtables: reject non-bridge targets

BugLink: http://bugs.launchpad.net/bugs/1811877
commit 11ff7288beb2b7da889a014aff0a7b80bf8efcf3 upstream.

the ebtables evaluation loop expects targets to return
positive values (jumps), or negative values (absolute verdicts).

This is completely different from what xtables does.
In xtables, targets are expected to return the standard netfilter
verdicts, i.e. NF_DROP, NF_ACCEPT, etc.

ebtables will consider these as jumps.

Therefore reject any target found due to unspec fallback.
v2: also reject watchers.  ebtables ignores their return value, so
a target that assumes skb ownership (and returns NF_STOLEN) causes
use-after-free.

The only watchers in the 'ebtables' front-end are log and nflog;
both have AF_BRIDGE specific wrappers on kernel side.

Reported-by: syzbot+2b43f681169a2a0d306a@syzkaller.appspotmail.com
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
net/bridge/netfilter/ebtables.c