From: John Fastabend <john.fastabend@gmail.com>
To: Daniel Borkmann <daniel@iogearbox.net>, davem@davemloft.net
Cc: tj@kernel.org, ast@kernel.org, mark.rutland@arm.com,
richard@nod.at, sp3485@columbia.edu, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 2/3] bpf: fix splat for illegal devmap percpu allocation
Date: Tue, 17 Oct 2017 09:28:34 -0700 [thread overview]
Message-ID: <6171eefe-6cbe-c67d-b023-fa531ce170d1@gmail.com> (raw)
In-Reply-To: <dd091b1fec763d74185a156ecd2f972810bdd1ce.1508251210.git.daniel@iogearbox.net>
On 10/17/2017 07:55 AM, Daniel Borkmann wrote:
> It was reported that syzkaller was able to trigger a splat on
> devmap percpu allocation due to illegal/unsupported allocation
> request size passed to __alloc_percpu():
>
> [ 70.094249] illegal size (32776) or align (8) for percpu allocation
> [ 70.094256] ------------[ cut here ]------------
> [ 70.094259] WARNING: CPU: 3 PID: 3451 at mm/percpu.c:1365 pcpu_alloc+0x96/0x630
> [...]
> [ 70.094325] Call Trace:
> [ 70.094328] __alloc_percpu_gfp+0x12/0x20
> [ 70.094330] dev_map_alloc+0x134/0x1e0
> [ 70.094331] SyS_bpf+0x9bc/0x1610
> [ 70.094333] ? selinux_task_setrlimit+0x5a/0x60
> [ 70.094334] ? security_task_setrlimit+0x43/0x60
> [ 70.094336] entry_SYSCALL_64_fastpath+0x1a/0xa5
>
> This was due to too large max_entries for the map such that we
> surpassed the upper limit of PCPU_MIN_UNIT_SIZE. It's fine to
> fail naturally here, so switch to __alloc_percpu_gfp() and pass
> __GFP_NOWARN instead.
>
> Fixes: 11393cc9b9be ("xdp: Add batching support to redirect map")
> Reported-by: Mark Rutland <mark.rutland@arm.com>
> Reported-by: Shankara Pailoor <sp3485@columbia.edu>
> Reported-by: Richard Weinberger <richard@nod.at>
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Cc: John Fastabend <john.fastabend@gmail.com>
> ---
Thanks!
Acked-by: John Fastabend <john.fastabend@gmail.com>
next prev parent reply other threads:[~2017-10-17 16:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 14:55 [PATCH net 0/3] Fix for BPF devmap percpu allocation splat Daniel Borkmann
2017-10-17 14:55 ` [PATCH net 1/3] mm, percpu: add support for __GFP_NOWARN flag Daniel Borkmann
2017-10-17 15:53 ` Alexei Starovoitov
2017-10-17 14:55 ` [PATCH net 2/3] bpf: fix splat for illegal devmap percpu allocation Daniel Borkmann
2017-10-17 15:54 ` Alexei Starovoitov
2017-10-17 16:28 ` John Fastabend [this message]
2017-10-17 14:55 ` [PATCH net 3/3] bpf: do not test for PCPU_MIN_UNIT_SIZE before percpu allocations Daniel Borkmann
2017-10-17 15:55 ` Alexei Starovoitov
2017-10-17 16:29 ` John Fastabend
2017-10-17 15:03 ` [PATCH net 0/3] Fix for BPF devmap percpu allocation splat David Laight
2017-10-17 15:11 ` Daniel Borkmann
2017-10-18 13:25 ` Tejun Heo
2017-10-18 14:03 ` Daniel Borkmann
2017-10-18 14:22 ` Daniel Borkmann
2017-10-18 15:28 ` Alexei Starovoitov
2017-10-18 15:31 ` Daniel Borkmann
2017-10-18 21:45 ` Dennis Zhou
2017-10-21 16:00 ` Tejun Heo
2017-10-19 12:14 ` David Miller
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=6171eefe-6cbe-c67d-b023-fa531ce170d1@gmail.com \
--to=john.fastabend@gmail.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=richard@nod.at \
--cc=sp3485@columbia.edu \
--cc=tj@kernel.org \
/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
all inboxes | Powered by JetHome®