diff options
author | Alexei Starovoitov <ast@kernel.org> | 2019-05-14 10:47:29 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-05-14 10:47:30 -0700 |
commit | 5db17c96771ffa735f5cdfbd9b44f52f319f2637 (patch) | |
tree | 18e46b9920b1807e4146e9ea2a273e3f3c4dcba4 /kernel/bpf/syscall.c | |
parent | 2474c62898c63f8bb122ffda2cd93fdaad55603a (diff) | |
parent | d2baab62a1434d3f81ce83e82cbc53e7f2843bbc (diff) |
Merge branch 'lru-map-fix'
Daniel Borkmann says:
====================
This set fixes LRU map eviction in combination with map lookups out
of system call side from user space. Main patch is the second one and
test cases are adapted and added in the last one. Thanks!
====================
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index ad3ccf82f31d..cb5440b02e82 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -808,7 +808,10 @@ static int map_lookup_elem(union bpf_attr *attr) err = map->ops->map_peek_elem(map, value); } else { rcu_read_lock(); - ptr = map->ops->map_lookup_elem(map, key); + if (map->ops->map_lookup_elem_sys_only) + ptr = map->ops->map_lookup_elem_sys_only(map, key); + else + ptr = map->ops->map_lookup_elem(map, key); if (IS_ERR(ptr)) { err = PTR_ERR(ptr); } else if (!ptr) { |