All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] bpf: bpf_event_entry_gen's alloc needs to be in atomic context
@ 2016-07-15 23:15 Daniel Borkmann
  2016-07-17  5:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2016-07-15 23:15 UTC (permalink / raw)
  To: davem; +Cc: alexei.starovoitov, netdev, Daniel Borkmann

Should have been obvious, only called from bpf() syscall via map_update_elem()
that calls bpf_fd_array_map_update_elem() under RCU read lock and thus this
must also be in GFP_ATOMIC, of course.

Fixes: 3b1efb196eee ("bpf, maps: flush own entries on perf map release")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
---
 Sorry for missing this typo, sigh.

 kernel/bpf/arraymap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index db1a743..633a650 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -430,7 +430,7 @@ static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file,
 {
 	struct bpf_event_entry *ee;
 
-	ee = kzalloc(sizeof(*ee), GFP_KERNEL);
+	ee = kzalloc(sizeof(*ee), GFP_ATOMIC);
 	if (ee) {
 		ee->event = perf_file->private_data;
 		ee->perf_file = perf_file;
-- 
1.9.3

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

* Re: [PATCH net-next] bpf: bpf_event_entry_gen's alloc needs to be in atomic context
  2016-07-15 23:15 [PATCH net-next] bpf: bpf_event_entry_gen's alloc needs to be in atomic context Daniel Borkmann
@ 2016-07-17  5:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-07-17  5:04 UTC (permalink / raw)
  To: daniel; +Cc: alexei.starovoitov, netdev

From: Daniel Borkmann <daniel@iogearbox.net>
Date: Sat, 16 Jul 2016 01:15:55 +0200

> Should have been obvious, only called from bpf() syscall via map_update_elem()
> that calls bpf_fd_array_map_update_elem() under RCU read lock and thus this
> must also be in GFP_ATOMIC, of course.
> 
> Fixes: 3b1efb196eee ("bpf, maps: flush own entries on perf map release")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Acked-by: Alexei Starovoitov <ast@kernel.org>

Applied.

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

end of thread, other threads:[~2016-07-17  5:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 23:15 [PATCH net-next] bpf: bpf_event_entry_gen's alloc needs to be in atomic context Daniel Borkmann
2016-07-17  5:04 ` David Miller

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.