From: Greg KH <greg@kroah.com>
To: Wei Wu <ww9210@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
netdev <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH bpf] bpf: Fix integer overflow in queue_stack_map_alloc.
Date: Thu, 22 Nov 2018 17:04:42 +0100 [thread overview]
Message-ID: <20181122160442.GA25649@kroah.com> (raw)
In-Reply-To: <CACmwppz=P2h-uM2OTc2CvnDg_Qgfhtk5-vzk0Jge1SAi2sym+A@mail.gmail.com>
On Thu, Nov 22, 2018 at 11:59:02PM +0800, Wei Wu wrote:
> Integer overflow in queue_stack_map_alloc when calculating size may
> lead to heap overflow of arbitrary length.
> The patch fix it by checking whether attr->max_entries+1 <
> attr->max_entries and bailing out if it is the case.
> The vulnerability is discovered with the assistance of syzkaller.
>
> Reported-by: Wei Wu <ww9210@gmail.com>
> To: Alexei Starovoitov <ast@kernel.org>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: netdev <netdev@vger.kernel.org>
> Cc: Eric Dumazet <edumazet@google.com>
> Cc: Greg KH <greg@kroah.com>
> Signed-off-by: Wei Wu <ww9210@gmail.com>
> ---
> kernel/bpf/queue_stack_maps.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/bpf/queue_stack_maps.c b/kernel/bpf/queue_stack_maps.c
> index 8bbd72d3a121..c35a8a4721c8 100644
> --- a/kernel/bpf/queue_stack_maps.c
> +++ b/kernel/bpf/queue_stack_maps.c
> @@ -67,6 +67,8 @@ static struct bpf_map *queue_stack_map_alloc(union
> bpf_attr *attr)
> u64 queue_size, cost;
>
> size = attr->max_entries + 1;
> + if (size < attr->max_entries)
> + return ERR_PTR(-EINVAL);
> value_size = attr->value_size;
Your tabs got eaten by your email client and they all disappeared,
making the patch impossible to apply :(
Care to try again?
thanks,
greg k-h
next prev parent reply other threads:[~2018-11-23 2:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 15:59 [PATCH bpf] bpf: Fix integer overflow in queue_stack_map_alloc Wei Wu
2018-11-22 16:04 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-11-22 16:35 ww9210
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=20181122160442.GA25649@kroah.com \
--to=greg@kroah.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=ww9210@gmail.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