All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf] netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
@ 2019-04-14 22:43 Florian Westphal
  2019-04-22  8:37 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2019-04-14 22:43 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal, syzbot+659574e7bcc7f7eb4df7

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>
---
 net/bridge/netfilter/ebtables.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index eb15891f8b9f..3cad01ac64e4 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -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;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH nf] netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON
  2019-04-14 22:43 [PATCH nf] netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON Florian Westphal
@ 2019-04-22  8:37 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2019-04-22  8:37 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel, syzbot+659574e7bcc7f7eb4df7

On Mon, Apr 15, 2019 at 12:43:00AM +0200, Florian Westphal wrote:
> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-22  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 22:43 [PATCH nf] netfilter: ebtables: CONFIG_COMPAT: drop a bogus WARN_ON Florian Westphal
2019-04-22  8:37 ` Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.