Skip to contentSkip to conversation

netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON

PATCH Applied Florian Westphal 2 participants 2 messages Apr 14, 2019 – Apr 22, 2019

Subsystems (3)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON

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 [email protected]
---
 net/bridge/netfilter/ebtables.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/bridge/netfilter/ebtables.c +2 -1
index eb15891f8b9f..3cad01ac64e4 100644
@@ -2032,7 +2032,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;
Signature · 1 line
2.21.0
maintainer Applied
#1 lore raw
Quoted 2 lines · Florian Westphal

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.

Applied, thanks Florian.