Skip to content

Commit f08d611

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Alexei Starovoitov says: ==================== pull-request: bpf 2019-03-01 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) fix sanitation rewrite, from Daniel. 2) fix error path on map_new_fd, from Peng. 3) fix icache flush address, from Paul. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents ed8fe20 + 3612af7 commit f08d611

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

arch/mips/net/ebpf_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
18191819

18201820
/* Update the icache */
18211821
flush_icache_range((unsigned long)ctx.target,
1822-
(unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
1822+
(unsigned long)&ctx.target[ctx.idx]);
18231823

18241824
if (bpf_jit_enable > 1)
18251825
/* Dump JIT code */

kernel/bpf/syscall.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -559,12 +559,12 @@ static int map_create(union bpf_attr *attr)
559559
err = bpf_map_new_fd(map, f_flags);
560560
if (err < 0) {
561561
/* failed to allocate fd.
562-
* bpf_map_put() is needed because the above
562+
* bpf_map_put_with_uref() is needed because the above
563563
* bpf_map_alloc_id() has published the map
564564
* to the userspace and the userspace may
565565
* have refcnt-ed it through BPF_MAP_GET_FD_BY_ID.
566566
*/
567-
bpf_map_put(map);
567+
bpf_map_put_with_uref(map);
568568
return err;
569569
}
570570

@@ -1986,7 +1986,7 @@ static int bpf_map_get_fd_by_id(const union bpf_attr *attr)
19861986

19871987
fd = bpf_map_new_fd(map, f_flags);
19881988
if (fd < 0)
1989-
bpf_map_put(map);
1989+
bpf_map_put_with_uref(map);
19901990

19911991
return fd;
19921992
}

kernel/bpf/verifier.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6920,7 +6920,8 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
69206920
u32 off_reg;
69216921

69226922
aux = &env->insn_aux_data[i + delta];
6923-
if (!aux->alu_state)
6923+
if (!aux->alu_state ||
6924+
aux->alu_state == BPF_ALU_NON_POINTER)
69246925
continue;
69256926

69266927
isneg = aux->alu_state & BPF_ALU_NEG_VALUE;

0 commit comments

Comments
 (0)