]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets
authorFlorian Westphal <fw@strlen.de>
Mon, 19 Feb 2018 00:24:15 +0000 (01:24 +0100)
committerJack Vogel <jack.vogel@oracle.com>
Thu, 5 Apr 2018 21:26:25 +0000 (14:26 -0700)
commitf6be91e89eacc23626db81355a4b13a1d1c6fa62
tree419af0d1603f119be147ebbea813514e104f1066
parente448ab8ca786a7b4ff515fc665ff72f75041a810
netfilter: ebtables: CONFIG_COMPAT: don't trust userland offsets

We need to make sure the offsets are not out of range of the
total size.
Also check that they are in ascending order.

The WARN_ON triggered by syzkaller (it sets panic_on_warn) is
changed to also bail out, no point in continuing parsing.

Briefly tested with simple ruleset of
-A INPUT --limit 1/s' --log
plus jump to custom chains using 32bit ebtables binary.

Reported-by: <syzbot+845a53d13171abf8bf29@syzkaller.appspotmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit b71812168571fa55e44cdd0254471331b9c4c4c6)

Orabug: 27774012
CVE: CVE-2018-1068

Signed-off-by: Tim Tianyang Chen <tianyang.chen@oracle.com>
Reviewed-by: Chuck Anderson <chuck.anderson@oracle.com>
net/bridge/netfilter/ebtables.c