summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-04-15 00:43:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 09:17:14 +0200
commit9331b51b7b059eb4dcf73f6cf766791cfc365859 (patch)
tree3878c5ffa0520b282a2772db2de575ce337fdbe2 /net
parentdcbb0ca6856c345af77063d652edb0c350a0ffe1 (diff)
downloadlinux-stable-9331b51b7b059eb4dcf73f6cf766791cfc365859.tar.gz
linux-stable-9331b51b7b059eb4dcf73f6cf766791cfc365859.tar.bz2
linux-stable-9331b51b7b059eb4dcf73f6cf766791cfc365859.zip
netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
commit 7caa56f006e9d712b44f27b32520c66420d5cbc6 upstream. It means userspace gave us a ruleset where there is some other data after the ebtables target but before the beginning of the next rule. Fixes: 81e675c227ec ("netfilter: ebtables: add CONFIG_COMPAT support") Reported-by: syzbot+659574e7bcc7f7eb4df7@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>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/netfilter/ebtables.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 5e3df32902b1..f8dfa7af4af5 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -2042,7 +2042,8 @@ static int ebt_size_mwt(struct compat_ebt_entry_mwt *match32,
if (match_kern)
match_kern->match_size = ret;
- if (WARN_ON(type == EBT_COMPAT_TARGET && size_left))
+ /* rule should have no remaining data after target */
+ if (type == EBT_COMPAT_TARGET && size_left)
return -EINVAL;
match32 = (struct compat_ebt_entry_mwt *) buf;