Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f08d6114 authored by David S. Miller's avatar David S. Miller
Browse files


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: default avatarDavid S. Miller <davem@davemloft.net>
parents ed8fe202 3612af78
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1819,7 +1819,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)


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


	if (bpf_jit_enable > 1)
	if (bpf_jit_enable > 1)
		/* Dump JIT code */
		/* Dump JIT code */
+3 −3
Original line number Original line Diff line number Diff line
@@ -559,12 +559,12 @@ static int map_create(union bpf_attr *attr)
	err = bpf_map_new_fd(map, f_flags);
	err = bpf_map_new_fd(map, f_flags);
	if (err < 0) {
	if (err < 0) {
		/* failed to allocate fd.
		/* failed to allocate fd.
		 * bpf_map_put() is needed because the above
		 * bpf_map_put_with_uref() is needed because the above
		 * bpf_map_alloc_id() has published the map
		 * bpf_map_alloc_id() has published the map
		 * to the userspace and the userspace may
		 * to the userspace and the userspace may
		 * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID.
		 * have refcnt-ed it through BPF_MAP_GET_FD_BY_ID.
		 */
		 */
		bpf_map_put(map);
		bpf_map_put_with_uref(map);
		return err;
		return err;
	}
	}


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


	fd = bpf_map_new_fd(map, f_flags);
	fd = bpf_map_new_fd(map, f_flags);
	if (fd < 0)
	if (fd < 0)
		bpf_map_put(map);
		bpf_map_put_with_uref(map);


	return fd;
	return fd;
}
}
+2 −1
Original line number Original line Diff line number Diff line
@@ -6920,7 +6920,8 @@ static int fixup_bpf_calls(struct bpf_verifier_env *env)
			u32 off_reg;
			u32 off_reg;


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


			isneg = aux->alu_state & BPF_ALU_NEG_VALUE;
			isneg = aux->alu_state & BPF_ALU_NEG_VALUE;