diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-04-24 00:49:46 +0200 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-04-24 00:49:47 +0200 |
commit | b3f8adee85e81a4e8b8ea842cdd9c8e5ec63573d (patch) | |
tree | 55c8684910f6c98ff7f47e8d3de239c20882e98e /kernel/bpf/arraymap.c | |
parent | 4dfe1bb95235c553e216222cf0c377faf191dacd (diff) | |
parent | 4fcfdfb83391c74e62683469289db42a143440ac (diff) | |
download | linux-b3f8adee85e81a4e8b8ea842cdd9c8e5ec63573d.tar.gz linux-b3f8adee85e81a4e8b8ea842cdd9c8e5ec63573d.tar.bz2 linux-b3f8adee85e81a4e8b8ea842cdd9c8e5ec63573d.zip |
Merge branch 'bpf-sockmap-fixes'
John Fastabend says:
====================
While testing sockmap with more programs (besides our test programs)
I found a couple issues.
The attached series fixes an issue where pinned maps were not
working correctly, blocking sockets returned zero, and an error
path that when the sock hit an out of memory case resulted in a
double page_put() while doing ingress redirects.
See individual patches for more details.
v2: Incorporated Daniel's feedback to use map ops for uref put op
which also fixed the build error discovered in v1.
v3: rename map_put_uref to map_release_uref
====================
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'kernel/bpf/arraymap.c')
-rw-r--r-- | kernel/bpf/arraymap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c index 14750e7c5ee4..027107f4be53 100644 --- a/kernel/bpf/arraymap.c +++ b/kernel/bpf/arraymap.c @@ -476,7 +476,7 @@ static u32 prog_fd_array_sys_lookup_elem(void *ptr) } /* decrement refcnt of all bpf_progs that are stored in this map */ -void bpf_fd_array_map_clear(struct bpf_map *map) +static void bpf_fd_array_map_clear(struct bpf_map *map) { struct bpf_array *array = container_of(map, struct bpf_array, map); int i; @@ -495,6 +495,7 @@ const struct bpf_map_ops prog_array_map_ops = { .map_fd_get_ptr = prog_fd_array_get_ptr, .map_fd_put_ptr = prog_fd_array_put_ptr, .map_fd_sys_lookup_elem = prog_fd_array_sys_lookup_elem, + .map_release_uref = bpf_fd_array_map_clear, }; static struct bpf_event_entry *bpf_event_entry_gen(struct file *perf_file, |