[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180214170354.e2pdqhb4yjeqr2cw@ast-mbp.dhcp.thefacebook.com>
Date: Wed, 14 Feb 2018 09:03:56 -0800
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Daniel Borkmann <daniel@...earbox.net>
Cc: ast@...nel.org, yhs@...com, netdev@...r.kernel.org
Subject: Re: [PATCH bpf] bpf: fix bpf_prog_array_copy_to_user warning from
perf event prog query
On Wed, Feb 14, 2018 at 03:31:00PM +0100, Daniel Borkmann wrote:
> syzkaller tried to perform a prog query in perf_event_query_prog_array()
> where struct perf_event_query_bpf had an ids_len of 1,073,741,353 and
> thus causing a warning due to failed kcalloc() allocation out of the
> bpf_prog_array_copy_to_user() helper. Given we cannot attach more than
> 64 programs to a perf event, there's no point in allowing huge ids_len.
> Therefore, allow a buffer that would fix the maximum number of ids and
> also add a __GFP_NOWARN to the temporary ids buffer.
>
> Fixes: f371b304f12e ("bpf/tracing: allow user space to query prog array on the same tp")
> Fixes: 0911287ce32b ("bpf: fix bpf_prog_array_copy_to_user() issues")
> Reported-by: syzbot+cab5816b0edbabf598b3@...kaller.appspotmail.com
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
Applied to bpf tree, Thanks for the quick fix Daniel.
Powered by blists - more mailing lists