aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-03-02 15:54:35 -0500
committerDavid S. Miller <davem@davemloft.net>2019-03-02 15:54:35 -0500
commit9eb359140cd307f8a14f61c19b155ffca5291057 (patch)
tree22d5143608ef1744ca4b7025414777defe8bcca5 /kernel/bpf
parentcf29576fee6016fa7004262cb98f57a2269178f1 (diff)
parent07f12b26e21ab359261bf75cfcb424fdc7daeb6d (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'kernel/bpf')
-rw-r--r--kernel/bpf/syscall.c6
-rw-r--r--kernel/bpf/verifier.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index ec7c552af76b..797a99c7493e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -577,12 +577,12 @@ static int map_create(union bpf_attr *attr)
577 err = bpf_map_new_fd(map, f_flags); 577 err = bpf_map_new_fd(map, f_flags);
578 if (err < 0) { 578 if (err < 0) {
579 /* failed to allocate fd. 579 /* failed to allocate fd.
580 * bpf_map_put() is needed because the above 580 * bpf_map_put_with_uref() is needed because the above
581 * bpf_map_alloc_id() has published the map 581 * bpf_map_alloc_id() has published the map
582 * to the userspace and the userspace may 582 * to the userspace and the userspace may
583 * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID. 583 * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID.
584 */ 584 */
585 bpf_map_put(map); 585 bpf_map_put_with_uref(map);
586 return err; 586 return err;
587 } 587 }
588 588
@@ -2025,7 +2025,7 @@ static int bpf_map_get_fd_by_id(const union bpf_attr *attr)
2025 2025
2026 fd = bpf_map_new_fd(map, f_flags); 2026 fd = bpf_map_new_fd(map, f_flags);
2027 if (fd < 0) 2027 if (fd < 0)
2028 bpf_map_put(map); 2028 bpf_map_put_with_uref(map);
2029 2029
2030 return fd; 2030 return fd;
2031} 2031}
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1b9496c41383..ebc3b264aa4d 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -7559,7 +7559,8 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
7559 u32 off_reg; 7559 u32 off_reg;
7560 7560
7561 aux = &env->insn_aux_data[i + delta]; 7561 aux = &env->insn_aux_data[i + delta];
7562 if (!aux->alu_state) 7562 if (!aux->alu_state ||
7563 aux->alu_state == BPF_ALU_NON_POINTER)
7563 continue; 7564 continue;
7564 7565
7565 isneg = aux->alu_state & BPF_ALU_NEG_VALUE; 7566 isneg = aux->alu_state & BPF_ALU_NEG_VALUE;