From: Paolo Abeni <pabeni@redhat.com>
To: Florian Westphal <fw@strlen.de>
Cc: netdev@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
Stephen Hemminger <stephen@networkplumber.org>,
netfilter-devel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH net] netfilter: check for out-of-bounds while copying compat entries
Date: Mon, 05 Mar 2018 16:17:36 +0100 [thread overview]
Message-ID: <1520263056.5898.6.camel@redhat.com> (raw)
In-Reply-To: <20180305143235.GK11889@breakpoint.cc>
On Mon, 2018-03-05 at 15:32 +0100, Florian Westphal wrote:
> Paolo Abeni <pabeni@redhat.com> wrote:
> > Currently, when coping ebt compat entries, no checks are in place
> > for the offsets provided by user space, so that syzbot was able to
> > trigger the following splat:
> > ---
> > net/bridge/netfilter/ebtables.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
> > index 02c4b409d317..54ceaff701fb 100644
> > --- a/net/bridge/netfilter/ebtables.c
> > +++ b/net/bridge/netfilter/ebtables.c
> > @@ -2114,7 +2114,7 @@ static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base,
> > unsigned int size;
> > char *buf = buf_start + offsets[i];
> >
> > - if (offsets[i] > offsets[j])
> > + if (offsets[i] > offsets[j] || offsets[j] > *total)
> > return -EINVAL;
>
> I thought i fixed this via b71812168571fa55e44cdd0254471331b9c4c4c6,
> and, after looking at it again I still don't see why that doesn't cover
> this :-(
Actually such commit fixes the issues (I just double-checked via
syzbot), the issue is I did not pull such changeset before starting
investigating this bug.
This patch is not needed, thanks.
Paolo
prev parent reply other threads:[~2018-03-05 15:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 14:07 [PATCH net] netfilter: check for out-of-bounds while copying compat entries Paolo Abeni
2018-03-05 14:32 ` Florian Westphal
2018-03-05 15:17 ` Paolo Abeni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520263056.5898.6.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=fw@strlen.de \
--cc=kadlec@blackhole.kfki.hu \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=stephen@networkplumber.org \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).